11
11
#include " KeyboardLayoutManager.h"
12
12
13
13
const char * KLM_CLASS_NAME = " KLM" ;
14
+ const char * KEYBOARD_NAME_DEFAULT = " DEFAULT " ;
14
15
const char * KEYBOARD_NAME_ISO = " ISO " ;
15
16
const char * KEYBOARD_NAME_ANSI = " ANSI " ;
16
17
const char * KEYBOARD_NAME_JIS = " JIS" ;
@@ -96,8 +97,10 @@ static const std::vector<keyboard_led> keyboard_zone_main =
96
97
{ 0 , 3 , 9 , 0 , KEY_EN_L, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
97
98
{ 0 , 3 , 10 , 0 , KEY_EN_SEMICOLON, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
98
99
{ 0 , 3 , 11 , 0 , KEY_EN_QUOTE, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
100
+ { 0 , 3 , 12 , 0 , KEY_EN_POUND, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT },
99
101
{ 0 , 3 , 13 , 0 , KEY_EN_ANSI_ENTER, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
100
102
{ 0 , 4 , 0 , 0 , KEY_EN_LEFT_SHIFT, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
103
+ { 0 , 4 , 1 , 0 , KEY_EN_ISO_BACK_SLASH, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
101
104
{ 0 , 4 , 2 , 0 , KEY_EN_Z, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
102
105
{ 0 , 4 , 3 , 0 , KEY_EN_X, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
103
106
{ 0 , 4 , 4 , 0 , KEY_EN_C, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
@@ -220,15 +223,25 @@ keyboard_keymap_overlay iso_azerty
220
223
}
221
224
};
222
225
226
+ keyboard_keymap_overlay ansi_qwerty
227
+ {
228
+ KEYBOARD_SIZE_FULL,
229
+ {
230
+ /* ---------------------------------------------------------------------------------------------------------*\
231
+ | Edit Keys |
232
+ \*---------------------------------------------------------------------------------------------------------*/
233
+ { 0 , 3 , 12 , 0 , KEY_EN_UNUSED, KEYBOARD_OPCODE_SWAP_ONLY, },
234
+ { 0 , 4 , 1 , 0 , KEY_EN_UNUSED, KEYBOARD_OPCODE_SWAP_ONLY, },
235
+ }
236
+ };
237
+
223
238
keyboard_keymap_overlay iso_qwerty
224
239
{
225
240
KEYBOARD_SIZE_FULL,
226
241
{
227
242
/* ---------------------------------------------------------------------------------------------------------*\
228
243
| Edit Keys |
229
244
\*---------------------------------------------------------------------------------------------------------*/
230
- { 0 , 3 , 12 , 0 , KEY_EN_POUND, KEYBOARD_OPCODE_SWAP_ONLY, },
231
- { 0 , 4 , 1 , 0 , KEY_EN_ISO_BACK_SLASH, KEYBOARD_OPCODE_SWAP_ONLY, },
232
245
{ 0 , 2 , 13 , 0 , KEY_EN_UNUSED, KEYBOARD_OPCODE_SWAP_ONLY, },
233
246
}
234
247
};
@@ -326,12 +339,18 @@ KeyboardLayoutManager::KeyboardLayoutManager(KEYBOARD_LAYOUT layout, KEYBOARD_SI
326
339
}
327
340
328
341
/* ---------------------------------------------------------------------*\
329
- | Modify the base ANSI QWERTY layout to the desired regional layout |
342
+ | Modify the base default QWERTY layout to the desired regional layout |
330
343
\*---------------------------------------------------------------------*/
331
344
std::string tmp_name;
332
345
333
346
switch (layout)
334
347
{
348
+ case KEYBOARD_LAYOUT::KEYBOARD_LAYOUT_ANSI_QWERTY:
349
+ ChangeKeys (ansi_qwerty);
350
+ tmp_name = KEYBOARD_NAME_ANSI;
351
+ tmp_name.append (KEYBOARD_NAME_QWERTY);
352
+ break ;
353
+
335
354
case KEYBOARD_LAYOUT::KEYBOARD_LAYOUT_ISO_AZERTY:
336
355
ChangeKeys (iso_azerty);
337
356
tmp_name = KEYBOARD_NAME_AZERTY;
@@ -354,7 +373,7 @@ KeyboardLayoutManager::KeyboardLayoutManager(KEYBOARD_LAYOUT layout, KEYBOARD_SI
354
373
break ;
355
374
356
375
default :
357
- tmp_name = KEYBOARD_NAME_ANSI ;
376
+ tmp_name = KEYBOARD_NAME_DEFAULT ;
358
377
tmp_name.append (KEYBOARD_NAME_QWERTY);
359
378
break ;
360
379
}
0 commit comments