2 Copyright 2016 Jun Wako <wakojun@gmail.com>
10 #include "action_code.h"
11 #include "actionmap.h"
14 // Universal map table: 8x16=128key
16 #define UNIMAP_COLS 16
18 /* Universal 128-key keyboard layout(8x16)
19 ,-----------------------------------------------.
20 |F13|F14|F15|F16|F17|F18|F19|F20|F21|F22|F23|F24|
21 ,---. |-----------------------------------------------| ,-----------. ,-----------.
22 |Esc| |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12| |PrS|ScL|Pau| |VDn|VUp|Mut|
23 `---' `-----------------------------------------------' `-----------' `-----------'
24 ,-----------------------------------------------------------. ,-----------. ,---------------.
25 | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|JPY|Bsp| |Ins|Hom|PgU| |NmL| /| *| -|
26 |-----------------------------------------------------------| |-----------| |---------------|
27 |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | |Del|End|PgD| | 7| 8| 9| +|
28 |-----------------------------------------------------------| `-----------' |---------------|
29 |CapsL | A| S| D| F| G| H| J| K| L| ;| '| #|Entr| | 4| 5| 6|KP,|
30 |-----------------------------------------------------------| ,---. |---------------|
31 |Shft| <| Z| X| C| V| B| N| M| ,| .| /| RO|Shift | |Up | | 1| 2| 3|Ent|
32 |-----------------------------------------------------------| ,-----------. |---------------|
33 |Ctl|Gui|Alt|MHEN| Space |HENK|KANA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| | 0 | .|KP=|
34 `-----------------------------------------------------------' `-----------' `---------------'
36 Gui: Windows key, Mac ⌘ key or Meta key
37 VDn Vup Mut: Volume control
38 < #: ISO keys(in UK legend)
40 KP,: Brazilian Keypad Comma
42 RO: Japanese ろ(Ro) or Brazilian /(Slash)
43 MHEN: Japanese 無変換(Non Conversion) or Korean Hanja
44 HENK: Japanese 変換(Conversion) or Korean Hangul/English
45 KANA: Japanese かな(Hiragana/Katakana)
46 https://en.wikipedia.org/wiki/Keyboard_layout#Japanese
47 https://en.wikipedia.org/wiki/Keyboard_layout#Hangul_.28for_Korean.29
50 K68,K69,K6A,K6B,K6C,K6D,K6E,K6F,K70,K71,K72,K73, \
51 K29, K3A,K3B,K3C,K3D,K3E,K3F,K40,K41,K42,K43,K44,K45, K46,K47,K48, K01,K02,K03, \
52 K35,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K2D,K2E,K74,K2A, K49,K4A,K4B, K53,K54,K55,K56, \
53 K2B,K14,K1A,K08,K15,K17,K1C,K18,K0C,K12,K13,K2F,K30, K31, K4C,K4D,K4E, K5F,K60,K61,K57, \
54 K39,K04,K16,K07,K09,K0A,K0B,K0D,K0E,K0F,K33,K34, K32,K28, K5C,K5D,K5E,K66, \
55 K79,K64,K1D,K1B,K06,K19,K05,K11,K10,K36,K37,K38, K75,K7D, K52, K59,K5A,K5B,K58, \
56 K78,K7B,K7A,K77, K2C, K76,K00,K7E,K7F,K65,K7C, K50,K51,K4F, K62,K63,K67 \
58 { AC_##K00, AC_##K01, AC_##K02, AC_##K03, AC_##K04, AC_##K05, AC_##K06, AC_##K07, /* 00-07 */ \
59 AC_##K08, AC_##K09, AC_##K0A, AC_##K0B, AC_##K0C, AC_##K0D, AC_##K0E, AC_##K0F }, /* 08-0F */ \
60 { AC_##K10, AC_##K11, AC_##K12, AC_##K13, AC_##K14, AC_##K15, AC_##K16, AC_##K17, /* 10-17 */ \
61 AC_##K18, AC_##K19, AC_##K1A, AC_##K1B, AC_##K1C, AC_##K1D, AC_##K1E, AC_##K1F }, /* 18-1F */ \
62 { AC_##K20, AC_##K21, AC_##K22, AC_##K23, AC_##K24, AC_##K25, AC_##K26, AC_##K27, /* 20-27 */ \
63 AC_##K28, AC_##K29, AC_##K2A, AC_##K2B, AC_##K2C, AC_##K2D, AC_##K2E, AC_##K2F }, /* 28-2F */ \
64 { AC_##K30, AC_##K31, AC_##K32, AC_##K33, AC_##K34, AC_##K35, AC_##K36, AC_##K37, /* 30-37 */ \
65 AC_##K38, AC_##K39, AC_##K3A, AC_##K3B, AC_##K3C, AC_##K3D, AC_##K3E, AC_##K3F }, /* 38-3F */ \
66 { AC_##K40, AC_##K41, AC_##K42, AC_##K43, AC_##K44, AC_##K45, AC_##K46, AC_##K47, /* 40-47 */ \
67 AC_##K48, AC_##K49, AC_##K4A, AC_##K4B, AC_##K4C, AC_##K4D, AC_##K4E, AC_##K4F }, /* 48-4F */ \
68 { AC_##K50, AC_##K51, AC_##K52, AC_##K53, AC_##K54, AC_##K55, AC_##K56, AC_##K57, /* 50-57 */ \
69 AC_##K58, AC_##K59, AC_##K5A, AC_##K5B, AC_##K5C, AC_##K5D, AC_##K5E, AC_##K5F }, /* 58-5F */ \
70 { AC_##K60, AC_##K61, AC_##K62, AC_##K63, AC_##K64, AC_##K65, AC_##K66, AC_##K67, /* 60-67 */ \
71 AC_##K68, AC_##K69, AC_##K6A, AC_##K6B, AC_##K6C, AC_##K6D, AC_##K6E, AC_##K6F }, /* 68-6F */ \
72 { AC_##K70, AC_##K71, AC_##K72, AC_##K73, AC_##K74, AC_##K75, AC_##K76, AC_##K77, /* 70-77 */ \
73 AC_##K78, AC_##K79, AC_##K7A, AC_##K7B, AC_##K7C, AC_##K7D, AC_##K7E, AC_##K7F } /* 78-7F */ \
77 /* Matrix poision for Universal 128-key keyboard
78 ,-----------------------------------------------.
79 | 68| 69| 6A| 6B| 6C| 6D| 6E| 6F| 70| 71| 72| 73|
80 ,---. |-----------------------------------------------| ,-----------. ,-----------.
81 | 29| | 3A| 3B| 3C| 3D| 3E| 3F| 40| 41| 42| 43| 44| 45| | 46| 47| 48| | 01| 02| 03|
82 `---' `-----------------------------------------------' `-----------' `-----------'
83 ,-----------------------------------------------------------. ,-----------. ,---------------.
84 | 35| 1E| 1F| 20| 21| 22| 23| 24| 25| 26| 27| 2D| 2E| 74| 2A| | 49| 4A| 4B| | 53| 54| 55| 56|
85 |-----------------------------------------------------------| |-----------| |---------------|
86 | 2B| 14| 1A| 08| 15| 17| 1C| 18| 0C| 12| 13| 2F| 30| 31| | 4C| 4D| 4E| | 5F| 60| 61| 57|
87 |-----------------------------------------------------------| `-----------' |---------------|
88 | 39| 04| 16| 07| 09| 0A| 0B| 0D| 0E| 0F| 33| 34| 32| 28| | 5C| 5D| 5E| 66|
89 |-----------------------------------------------------------| ,---. |---------------|
90 | 79| 64| 1D| 1B| 06| 19| 05| 11| 10| 36| 37| 38| 75| 7D| | 52| | 59| 5A| 5B| 58|
91 |-----------------------------------------------------------| ,-----------. |---------------|
92 | 78| 7B| 7A| 77| 2C| 76| 00| 7E| 7F| 65| 7C| | 50| 51| 4F| | 62| 63| 67|
93 `-----------------------------------------------------------' `-----------' `---------------'
95 // Universal map position codes
96 enum unimap_position_codes {
97 // logical name position(row << 4 | col)
98 // ------------------------------------------------
100 UNIMAP_VOLUME_DOWN, // 0x01
101 UNIMAP_VOLUME_UP, // 0x02
102 UNIMAP_VOLUME_MUTE, // 0x03
139 UNIMAP_ENTER, // 0x28
140 UNIMAP_ESCAPE, // 0x29
141 UNIMAP_BSPACE, // 0x2A
143 UNIMAP_SPACE, // 0x2C
144 UNIMAP_MINUS, // 0x2D
145 UNIMAP_EQUAL, // 0x2E
146 UNIMAP_LBRACKET, // 0x2F
147 UNIMAP_RBRACKET, // 0x30
148 UNIMAP_BSLASH, // 0x31
149 UNIMAP_NONUS_HASH, // 0x32 ISO UK hash
150 UNIMAP_SCOLON, // 0x33
151 UNIMAP_QUOTE, // 0x34
152 UNIMAP_GRAVE, // 0x35
153 UNIMAP_COMMA, // 0x36
155 UNIMAP_SLASH, // 0x38
156 UNIMAP_CAPSLOCK, // 0x39
169 UNIMAP_PSCREEN, // 0x46
170 UNIMAP_SCROLLLOCK, // 0x47
171 UNIMAP_PAUSE, // 0x48
172 UNIMAP_INSERT, // 0x49
175 UNIMAP_DELETE, // 0x4C
177 UNIMAP_PGDOWN, // 0x4E
178 UNIMAP_RIGHT, // 0x4F
182 UNIMAP_NUMLOCK, // 0x53
183 UNIMAP_KP_SLASH, // 0x54
184 UNIMAP_KP_ASTERISK, // 0x55
185 UNIMAP_KP_MINUS, // 0x56
186 UNIMAP_KP_PLUS, // 0x57
187 UNIMAP_KP_ENTER, // 0x58
198 UNIMAP_KP_DOT, // 0x63
199 UNIMAP_NONUS_BSLASH, // 0x64 ISO UK backslash
200 UNIMAP_APPLICATION, // 0x65
201 UNIMAP_KP_COMMA, // 0x66
202 UNIMAP_KP_EQUAL, // 0x67
219 UNIMAP_LCTRL, // 0x78
220 UNIMAP_LSHIFT, // 0x79
223 UNIMAP_RCTRL, // 0x7C
224 UNIMAP_RSHIFT, // 0x7D
233 #define UNIMAP_LCTL UNIMAP_LCTRL
234 #define UNIMAP_RCTL UNIMAP_RCTRL
235 #define UNIMAP_LSFT UNIMAP_LSHIFT
236 #define UNIMAP_RSFT UNIMAP_RSHIFT
237 #define UNIMAP_ESC UNIMAP_ESCAPE
238 #define UNIMAP_BSPC UNIMAP_BSPACE
239 #define UNIMAP_ENT UNIMAP_ENTER
240 #define UNIMAP_DEL UNIMAP_DELETE
241 #define UNIMAP_INS UNIMAP_INSERT
242 #define UNIMAP_CAPS UNIMAP_CAPSLOCK
243 #define UNIMAP_CLCK UNIMAP_CAPSLOCK
244 #define UNIMAP_RGHT UNIMAP_RIGHT
245 #define UNIMAP_PGDN UNIMAP_PGDOWN
246 #define UNIMAP_PSCR UNIMAP_PSCREEN
247 #define UNIMAP_SLCK UNIMAP_SCROLLLOCK
248 #define UNIMAP_PAUS UNIMAP_PAUSE
249 #define UNIMAP_BRK UNIMAP_PAUSE
250 #define UNIMAP_NLCK UNIMAP_NUMLOCK
251 #define UNIMAP_SPC UNIMAP_SPACE
252 #define UNIMAP_MINS UNIMAP_MINUS
253 #define UNIMAP_EQL UNIMAP_EQUAL
254 #define UNIMAP_GRV UNIMAP_GRAVE
255 #define UNIMAP_RBRC UNIMAP_RBRACKET
256 #define UNIMAP_LBRC UNIMAP_LBRACKET
257 #define UNIMAP_COMM UNIMAP_COMMA
258 #define UNIMAP_BSLS UNIMAP_BSLASH
259 #define UNIMAP_SLSH UNIMAP_SLASH
260 #define UNIMAP_SCLN UNIMAP_SCOLON
261 #define UNIMAP_QUOT UNIMAP_QUOTE
262 #define UNIMAP_APP UNIMAP_APPLICATION
263 #define UNIMAP_NUHS UNIMAP_NONUS_HASH
264 #define UNIMAP_NUBS UNIMAP_NONUS_BSLASH
265 /* Japanese specific */
266 #define UNIMAP_ZKHK UNIMAP_GRAVE
268 #define UNIMAP_P1 UNIMAP_KP_1
269 #define UNIMAP_P2 UNIMAP_KP_2
270 #define UNIMAP_P3 UNIMAP_KP_3
271 #define UNIMAP_P4 UNIMAP_KP_4
272 #define UNIMAP_P5 UNIMAP_KP_5
273 #define UNIMAP_P6 UNIMAP_KP_6
274 #define UNIMAP_P7 UNIMAP_KP_7
275 #define UNIMAP_P8 UNIMAP_KP_8
276 #define UNIMAP_P9 UNIMAP_KP_9
277 #define UNIMAP_P0 UNIMAP_KP_0
278 #define UNIMAP_PDOT UNIMAP_KP_DOT
279 #define UNIMAP_PCMM UNIMAP_KP_COMMA
280 #define UNIMAP_PSLS UNIMAP_KP_SLASH
281 #define UNIMAP_PAST UNIMAP_KP_ASTERISK
282 #define UNIMAP_PMNS UNIMAP_KP_MINUS
283 #define UNIMAP_PPLS UNIMAP_KP_PLUS
284 #define UNIMAP_PEQL UNIMAP_KP_EQUAL
285 #define UNIMAP_PENT UNIMAP_KP_ENTER
287 #define UNIMAP_MUTE UNIMAP_VOLUME_MUTE
288 #define UNIMAP_VOLU UNIMAP_VOLUME_UP
289 #define UNIMAP_VOLD UNIMAP_VOLUME_DOWN