apply Brian's libwiikeyboard patches
[libogc.git] / gc / wiikeyboard / keymapper.h
blob01ee49ec5369ff889a64463c857dd4a26648d124
1 #ifndef __KEYMAPPER_H__
2 #define __KEYMAPPER_H__
4 #ifdef __cplusplus
5 extern "C" {
6 #endif /* __cplusplus */
8 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
10 struct symbol {
11 u8 scancode;
12 u16 group1[2];
13 u16 group2[2];
16 struct keymap {
17 char name[12];
18 long map_length;
19 struct symbol symbols[];
22 #define BEGIN_KEYMAP(title, size) \
23 struct keymap title = { \
24 .name = #title, \
25 .map_length = size, \
26 .symbols = {
29 #define END_KEYMAP \
30 }, \
33 #define MAP(scan, ks1, ks2) \
34 {scan, {KBD_##ks1, KBD_##ks2}, {KBD_##ks1, KBD_##ks2}},
36 #define EXT_MAP(scan, ks1, ks2, ks3, ks4) \
37 {scan, {KBD_##ks1, KBD_##ks2}, {KBD_##ks3, KBD_##ks4}},
39 #ifdef __cplusplus
41 #endif /* __cplusplus */
43 #endif /* __KEYMAPPER_H__ */