forked from tmk/tmk_keyboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathunimap_trans.h
244 lines (236 loc) · 9.57 KB
/
unimap_trans.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
/*
Copyright 2016 Jun Wako <[email protected]>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef UNIMAP_COMMON_H
#define UNIMAP_COMMON_H
#include <stdint.h>
#include <avr/pgmspace.h>
#include "unimap.h"
/* M0110A scan codes
* ,---------------------------------------------------------. ,---------------.
* | 32| 12| 13| 14| 15| 17| 16| 1A| 1C| 19| 1D| 1B| 18| 33| | 47| 68| 6D| 62|
* |---------------------------------------------------------| |---------------|
* | 30| 0C| 0D| 0E| 0F| 11| 10| 20| 22| 1F| 23| 21| 1E| | | 59| 5B| 5C| 4E|
* |-----------------------------------------------------' | |---------------|
* | 39| 00| 01| 02| 03| 05| 04| 26| 28| 25| 29| 27| 24| | 56| 57| 58| 66|
* |---------------------------------------------------------| |---------------|
* | 38| 06| 07| 08| 09| 0B| 2D| 2E| 2B| 2F| 2C| 38| 4D| | 53| 54| 55| |
* `---------------------------------------------------------' |-----------| 4C|
* | 3A| 37| 31 | 2A| 46| 42| 48| | 52| 41| |
* `---------------------------------------------------------' `---------------'
*
* M0110 + M0120 scan codes
* ,---------------------------------------------------------. ,---------------.
* | 32| 12| 13| 14| 15| 17| 16| 1A| 1C| 19| 1D| 1B| 18| 33| | 47| 68| 6D| 62|
* |---------------------------------------------------------| |---------------|
* | 30| 0C| 0D| 0E| 0F| 11| 10| 20| 22| 1F| 23| 21| 1E| 2A| | 59| 5B| 5C| 4E|
* |---------------------------------------------------------| |---------------|
* | 39| 00| 01| 02| 03| 05| 04| 26| 28| 25| 29| 27| 24| | 56| 57| 58| 66|
* |---------------------------------------------------------| |---------------|
* | 38| 06| 07| 08| 09| 0B| 2D| 2E| 2B| 2F| 2C| 38| | 53| 54| 55| |
* `---------------------------------------------------------' |-----------| 4C|
* | 3A| 37| 31 | 34| 3A| | 52| 41| |
* `------------------------------------------------' `---------------'
*
* International M0110
* https://en.wikipedia.org/wiki/File:Apple_Macintosh_Plus_Keyboard.jpg
* Probably International keyboard layout of M0110A doesn't exist.
* ,---------------------------------------------------------.
* | 32| 12| 13| 14| 15| 17| 16| 1A| 1C| 19| 1D| 1B| 18| 33|
* |---------------------------------------------------------|
* | 30| 0C| 0D| 0E| 0F| 11| 10| 20| 22| 1F| 23| 21| 1E| 2A|
* |------------------------------------------------------, |
* | 39| 00| 01| 02| 03| 05| 04| 26| 28| 25| 29| 27| 24| |
* |---------------------------------------------------------|
* | 38| 06| 07| 08| 09| 0B| 2D| 2E| 2B| 2F| 2C| 0A| 38|
* `---------------------------------------------------------'
* | 3A| 37| 34 | 31| 3A|
* `------------------------------------------------'
*/
const uint8_t PROGMEM unimap_trans[MATRIX_ROWS][MATRIX_COLS] = {
// Position(unimap) scan code(matrix)
// ---------------------------------------------
{
UNIMAP_A, // 0x00
UNIMAP_S, // 0x01
UNIMAP_D, // 0x02
UNIMAP_F, // 0x03
UNIMAP_H, // 0x04
UNIMAP_G, // 0x05
#ifdef M0110_INTL
UNIMAP_NONUS_BSLASH, // 0x06
UNIMAP_Z, // 0x07
},
{
UNIMAP_X, // 0x08
UNIMAP_C, // 0x09
UNIMAP_SLASH, // 0x0A
UNIMAP_V, // 0x0B
#else
UNIMAP_Z, // 0x06
UNIMAP_X, // 0x07
},
{
UNIMAP_C, // 0x08
UNIMAP_V, // 0x09
UNIMAP_NO, // 0x0A
UNIMAP_B, // 0x0B
#endif
UNIMAP_Q, // 0x0C
UNIMAP_W, // 0x0D
UNIMAP_E, // 0x0E
UNIMAP_R, // 0x0F
},
{
UNIMAP_Y, // 0x10
UNIMAP_T, // 0x11
UNIMAP_1, // 0x12
UNIMAP_2, // 0x13
UNIMAP_3, // 0x14
UNIMAP_4, // 0x15
UNIMAP_6, // 0x16
UNIMAP_5, // 0x17
},
{
UNIMAP_EQUAL, // 0x18
UNIMAP_9, // 0x19
UNIMAP_7, // 0x1A
UNIMAP_MINUS, // 0x1B
UNIMAP_8, // 0x1C
UNIMAP_0, // 0x1D
UNIMAP_RBRACKET, // 0x1E
UNIMAP_O, // 0x1F
},
{
UNIMAP_U, // 0x20
UNIMAP_LBRACKET, // 0x21
UNIMAP_I, // 0x22
UNIMAP_P, // 0x23
#ifdef M0110_INTL
UNIMAP_NONUS_HASH, // 0x24
#else
UNIMAP_ENTER, // 0x24
#endif
UNIMAP_L, // 0x25
UNIMAP_J, // 0x26
UNIMAP_QUOTE, // 0x27
},
{
UNIMAP_K, // 0x28
UNIMAP_SCOLON, // 0x29
#ifdef M0110_INTL
UNIMAP_ENTER, // 0x2A
UNIMAP_M, // 0x2B
UNIMAP_DOT, // 0x2C
UNIMAP_B, // 0x2D
UNIMAP_N, // 0x2E
UNIMAP_COMMA, // 0x2F
#else
UNIMAP_BSLASH, // 0x2A
UNIMAP_COMMA, // 0x2B
UNIMAP_SLASH, // 0x2C
UNIMAP_N, // 0x2D
UNIMAP_M, // 0x2E
UNIMAP_DOT, // 0x2F
#endif
},
{
UNIMAP_TAB, // 0x30
#ifdef M0110_INTL
UNIMAP_RGUI, // 0x31
#else
UNIMAP_SPACE, // 0x31
#endif
UNIMAP_GRAVE, // 0x32
UNIMAP_BSPACE, // 0x33
#ifdef M0110_INTL
UNIMAP_SPACE, // 0x34
#else
UNIMAP_RGUI, // 0x34
#endif
UNIMAP_NO, // 0x35
UNIMAP_NO, // 0x36
UNIMAP_LGUI, // 0x37
},
{
UNIMAP_LSHIFT, // 0x38
UNIMAP_CAPSLOCK, // 0x39
UNIMAP_LALT, // 0x3A
UNIMAP_NO, // 0x3B
UNIMAP_NO, // 0x3C
UNIMAP_NO, // 0x3D
UNIMAP_NO, // 0x3E
UNIMAP_NO, // 0x3F
},
{
UNIMAP_NO, // 0x40
UNIMAP_KP_DOT, // 0x41
UNIMAP_RIGHT, // 0x42
UNIMAP_NO, // 0x43
UNIMAP_NO, // 0x44
UNIMAP_NO, // 0x45
UNIMAP_LEFT, // 0x46
UNIMAP_NUMLOCK, // 0x47
},
{
UNIMAP_DOWN, // 0x48
UNIMAP_NO, // 0x49
UNIMAP_NO, // 0x4A
UNIMAP_NO, // 0x4B
UNIMAP_KP_ENTER, // 0x4C
UNIMAP_UP, // 0x4D
UNIMAP_KP_PLUS, // 0x4E keypad minus
UNIMAP_NO, // 0x4F
},
{
UNIMAP_NO, // 0x50
UNIMAP_NO, // 0x51
UNIMAP_KP_0, // 0x52
UNIMAP_KP_1, // 0x53
UNIMAP_KP_2, // 0x54
UNIMAP_KP_3, // 0x55
UNIMAP_KP_4, // 0x56
UNIMAP_KP_5, // 0x57
},
{
UNIMAP_KP_6, // 0x58
UNIMAP_KP_7, // 0x59
UNIMAP_NO, // 0x5A
UNIMAP_KP_8, // 0x5B
UNIMAP_KP_9, // 0x5C
UNIMAP_NO, // 0x5D
UNIMAP_NO, // 0x5E
UNIMAP_NO, // 0x5F
},
{
UNIMAP_NO, // 0x60
UNIMAP_NO, // 0x61
UNIMAP_KP_MINUS, // 0x62 keypad asterisk
UNIMAP_NO, // 0x63
UNIMAP_NO, // 0x64
UNIMAP_NO, // 0x65
UNIMAP_KP_COMMA, // 0x66
UNIMAP_NO, // 0x67
},
{
UNIMAP_KP_SLASH, // 0x68 keypad equal
UNIMAP_NO, // 0x69
UNIMAP_NO, // 0x6A
UNIMAP_NO, // 0x6B
UNIMAP_NO, // 0x6C
UNIMAP_KP_ASTERISK, // 0x6D keypad slash
UNIMAP_NO, // 0x6E compose
UNIMAP_NO, // 0x6F
},
};
#endif