Rev 3933 | Rev 4036 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3933 | Rev 4035 | ||
---|---|---|---|
Line 163... | Line 163... | ||
163 | }; |
163 | }; |
164 | 164 | ||
165 | static char map_neutral[] = { |
165 | static char map_neutral[] = { |
166 | [KC_BACKSPACE] = '\b', |
166 | [KC_BACKSPACE] = '\b', |
167 | [KC_TAB] = '\t', |
167 | [KC_TAB] = '\t', |
168 | [KC_ENTER] = '\n' |
168 | [KC_ENTER] = '\n', |
- | 169 | [KC_SPACE] = ' ', |
|
- | 170 | ||
- | 171 | [KC_NSLASH] = '/', |
|
- | 172 | [KC_NTIMES] = '*', |
|
- | 173 | [KC_NMINUS] = '-', |
|
- | 174 | [KC_NPLUS] = '+', |
|
- | 175 | [KC_NENTER] = '\n' |
|
- | 176 | }; |
|
- | 177 | ||
- | 178 | static char map_numeric[] = { |
|
- | 179 | [KC_N7] = '7', |
|
- | 180 | [KC_N8] = '8', |
|
- | 181 | [KC_N9] = '9', |
|
- | 182 | [KC_N4] = '4', |
|
- | 183 | [KC_N5] = '5', |
|
- | 184 | [KC_N6] = '6', |
|
- | 185 | [KC_N1] = '1', |
|
- | 186 | [KC_N2] = '2', |
|
- | 187 | [KC_N3] = '3', |
|
- | 188 | ||
- | 189 | [KC_N0] = '0', |
|
- | 190 | [KC_NPERIOD] = '.' |
|
169 | }; |
191 | }; |
170 | 192 | ||
171 | static int translate(unsigned int key, char *map, size_t map_length) |
193 | static int translate(unsigned int key, char *map, size_t map_length) |
172 | { |
194 | { |
173 | if (key >= map_length) return 0; |
195 | if (key >= map_length) return 0; |
Line 197... | Line 219... | ||
197 | else |
219 | else |
198 | c = translate(ev->key, map_not_shifted, sizeof(map_not_shifted) / sizeof(char)); |
220 | c = translate(ev->key, map_not_shifted, sizeof(map_not_shifted) / sizeof(char)); |
199 | 221 | ||
200 | if (c != 0 ) return c; |
222 | if (c != 0) return c; |
201 | 223 | ||
- | 224 | if ((ev->mods & KM_NUM_LOCK) != 0) |
|
- | 225 | c = translate(ev->key, map_numeric, sizeof(map_numeric) / sizeof(char)); |
|
202 | } |
226 | else |
- | 227 | c = 0; |
|
203 | 228 | ||
- | 229 | return c; |
|
- | 230 | } |
|
204 | 231 | ||
205 | /** |
232 | /** |
206 | * @} |
233 | * @} |
207 | */ |
234 | */ |