Skip to content

Commit f694064

Browse files
Add default KLM layout (ANSI+ISO QWERTY)
1 parent 1d45ca4 commit f694064

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

KeyboardLayoutManager/KeyboardLayoutManager.cpp

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "KeyboardLayoutManager.h"
1212

1313
const char* KLM_CLASS_NAME = "KLM";
14+
const char* KEYBOARD_NAME_DEFAULT = "DEFAULT ";
1415
const char* KEYBOARD_NAME_ISO = "ISO ";
1516
const char* KEYBOARD_NAME_ANSI = "ANSI ";
1617
const char* KEYBOARD_NAME_JIS = "JIS";
@@ -96,8 +97,10 @@ static const std::vector<keyboard_led> keyboard_zone_main =
9697
{ 0, 3, 9, 0, KEY_EN_L, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
9798
{ 0, 3, 10, 0, KEY_EN_SEMICOLON, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
9899
{ 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 },
99101
{ 0, 3, 13, 0, KEY_EN_ANSI_ENTER, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
100102
{ 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, },
101104
{ 0, 4, 2, 0, KEY_EN_Z, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
102105
{ 0, 4, 3, 0, KEY_EN_X, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
103106
{ 0, 4, 4, 0, KEY_EN_C, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
@@ -220,15 +223,25 @@ keyboard_keymap_overlay iso_azerty
220223
}
221224
};
222225

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+
223238
keyboard_keymap_overlay iso_qwerty
224239
{
225240
KEYBOARD_SIZE_FULL,
226241
{
227242
/*---------------------------------------------------------------------------------------------------------*\
228243
| Edit Keys |
229244
\*---------------------------------------------------------------------------------------------------------*/
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, },
232245
{ 0, 2, 13, 0, KEY_EN_UNUSED, KEYBOARD_OPCODE_SWAP_ONLY, },
233246
}
234247
};
@@ -326,12 +339,18 @@ KeyboardLayoutManager::KeyboardLayoutManager(KEYBOARD_LAYOUT layout, KEYBOARD_SI
326339
}
327340

328341
/*---------------------------------------------------------------------*\
329-
| Modify the base ANSI QWERTY layout to the desired regional layout |
342+
| Modify the base default QWERTY layout to the desired regional layout |
330343
\*---------------------------------------------------------------------*/
331344
std::string tmp_name;
332345

333346
switch(layout)
334347
{
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+
335354
case KEYBOARD_LAYOUT::KEYBOARD_LAYOUT_ISO_AZERTY:
336355
ChangeKeys(iso_azerty);
337356
tmp_name = KEYBOARD_NAME_AZERTY;
@@ -354,7 +373,7 @@ KeyboardLayoutManager::KeyboardLayoutManager(KEYBOARD_LAYOUT layout, KEYBOARD_SI
354373
break;
355374

356375
default:
357-
tmp_name = KEYBOARD_NAME_ANSI;
376+
tmp_name = KEYBOARD_NAME_DEFAULT;
358377
tmp_name.append(KEYBOARD_NAME_QWERTY);
359378
break;
360379
}

0 commit comments

Comments
 (0)