2 Copyright 2016 Jun Wako <wakojun@gmail.com>
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 #ifndef UNIMAP_COMMON_H
18 #define UNIMAP_COMMON_H
21 #include <avr/pgmspace.h>
25 /* Apple Extended Keyboard Common layout: ANSI+ISO
26 * ,---. .---------------. ,---------------. ,---------------. ,-----------. ,---------------.
27 * |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| |VDn|VUp|Mut|F24|
28 * `---' `---------------' `---------------' `---------------' `-----------' `---------------'
29 * ,-----------------------------------------------------------. ,-----------. ,---------------.
30 * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backspa| |Ins|Hom|PgU| |NmL| =| /| *|
31 * |-----------------------------------------------------------| |-----------| |---------------|
32 * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |Del|End|PgD| | 7| 8| 9| -|
33 * |-----------------------------------------------------------| `-----------' |---------------|
34 * |CapsLo| A| S| D| F| G| H| J| K| L| ;| '|Return | | 4| 5| 6| +|
35 * |-----------------------------------------------------------| ,---. |---------------|
36 * |Shif|\ | Z| X| C| V| B| N| M| ,| ,| /|Shift | |Up | | 1| 2| 3| |
37 * |-----------------------------------------------------------| ,-----------. |-----------|Ent|
38 * |Ctrl |Alt |Gui | Space |Gui |Alt |Ctrl | |Lef|Dow|Rig| | 0| .| |
39 * `-----------------------------------------------------------' `-----------' `---------------'
43 * Mic = F13(Adjustable keyboard)
45 // http://lxr.free-electrons.com/source/drivers/macintosh/adbhid.c
46 // http://opensource.apple.com//source/IOHIDFamily/IOHIDFamily-701.20.10/IOHIDFamily/Cosmo_USB2ADB.c
47 // http://m0115.web.fc2.com/m0115.jpg
48 const uint8_t PROGMEM unimap_trans[MATRIX_ROWS][MATRIX_COLS] = {
49 // Position(unimap) ADB scan code(matrix)
50 // ---------------------------------------------
64 UNIMAP_NONUS_BSLASH, // 0x0A
88 UNIMAP_RBRACKET, // 0x1E
93 UNIMAP_LBRACKET, // 0x21
103 UNIMAP_SCOLON, // 0x29
104 UNIMAP_BSLASH, // 0x2A
105 UNIMAP_COMMA, // 0x2B
106 UNIMAP_SLASH, // 0x2C
113 UNIMAP_SPACE, // 0x31
114 UNIMAP_GRAVE, // 0x32
115 UNIMAP_BSPACE, // 0x33
116 UNIMAP_KP_ENTER, // 0x34
117 UNIMAP_ESCAPE, // 0x35
118 UNIMAP_LCTRL, // 0x36
122 UNIMAP_LSHIFT, // 0x38
123 UNIMAP_CAPSLOCK, // 0x39
126 UNIMAP_RIGHT, // 0x3C
129 UNIMAP_F23, // 0x3F FN?
133 UNIMAP_KP_DOT, // 0x41
134 UNIMAP_F13, // 0x42 Mic(Adjustable keyboard)
135 UNIMAP_KP_MINUS, // 0x43 ADB keypad asterisk(top right)
137 UNIMAP_KP_COMMA, // 0x45 ADB keypad plus
139 UNIMAP_NUMLOCK, // 0x47
142 UNIMAP_VOLUME_UP, // 0x48 Vol Up(Adjustable keyboard)
143 UNIMAP_VOLUME_DOWN, // 0x49 Vol Down(Adjustable keyboard)
144 UNIMAP_VOLUME_MUTE, // 0x4A Vol Mute(Adjustable keyboard)
145 UNIMAP_KP_ASTERISK, // 0x4B ADB keypad slash(between equal and asterisk)
146 UNIMAP_KP_ENTER, // 0x4C
148 UNIMAP_KP_PLUS, // 0x4E ADB keypad minus
153 UNIMAP_KP_SLASH, // 0x51 ADB keypad equal(next to clear/numlock)
169 UNIMAP_KP_COMMA, // 0x5F
183 UNIMAP_PSCREEN, // 0x69
185 UNIMAP_SCROLLLOCK, // 0x6B
188 UNIMAP_APPLICATION, // 0x6E compose
193 UNIMAP_PAUSE, // 0x71
194 UNIMAP_INSERT, // 0x72
197 UNIMAP_DELETE, // 0x75
203 UNIMAP_PGDOWN, // 0x79
205 UNIMAP_RSHIFT, // 0x7B
207 UNIMAP_RCTRL, // 0x7D
209 UNIMAP_F24, // 0x7F power key