From a1cfd7253d7c0bc36c4879c115dcaae754835c72 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Mon, 2 Jan 2023 17:12:38 -0600 Subject: [PATCH] =?UTF-8?q?fix(common):=20update=20USVirtualKeyMap=20to=20?= =?UTF-8?q?actually=20be=20US=F0=9F=99=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit comon/web/types: - the USVirtualKeyMap was actually somewhat ISO-ish. Correct it. - also, add the spacebar row. - create a new ISOVirtualKeyMap, but not linked in anywhere. core/tests: - add a new test keyboard, k_010_mt.xml which is Maltese 47-key - update k_003 which was impacted by this For: #7965 --- .../types/src/consts/virtual-key-constants.ts | 23 +++- .../unit/ldml/keyboards/k_003_transform.xml | 5 +- core/tests/unit/ldml/keyboards/k_010_mt.xml | 101 ++++++++++++++++++ core/tests/unit/ldml/keyboards/meson.build | 4 + 4 files changed, 128 insertions(+), 5 deletions(-) create mode 100644 core/tests/unit/ldml/keyboards/k_010_mt.xml diff --git a/common/web/types/src/consts/virtual-key-constants.ts b/common/web/types/src/consts/virtual-key-constants.ts index ac4f01bc65..b3ebdc15c5 100644 --- a/common/web/types/src/consts/virtual-key-constants.ts +++ b/common/web/types/src/consts/virtual-key-constants.ts @@ -136,8 +136,27 @@ export const USVirtualKeyMap: number[][] = [ [ k.K_Q, k.K_W, k.K_E, k.K_R, k.K_T, k.K_Y, k.K_U, k.K_I, k.K_O, k.K_P, k.K_LBRKT, k.K_RBRKT, k.K_BKSLASH ], // [caps] A S D F G H J K L ; ' [enter] [ k.K_A, k.K_S, k.K_D, k.K_F, k.K_G, k.K_H, k.K_J, k.K_K, k.K_L, k.K_COLON, k.K_QUOTE ], + // [shift] Z X C V B N M , . / [shift] *=oE2 + [ k.K_Z, k.K_X, k.K_C, k.K_V, k.K_B, k.K_N, k.K_M, k.K_COMMA, k.K_PERIOD, k.K_SLASH ], + // space + [ k.K_SPACE ], +]; + +/** + * TODO-LDML: WIP ISO layout for #7965 + * May not be correct to use US codes? + */ +export const ISOVirtualKeyMap: number[][] = [ + // ` 1 2 3 4 5 6 7 8 9 0 - = [bksp] + [ k.K_BKQUOTE, k.K_1, k.K_2, k.K_3, k.K_4, k.K_5, k.K_6, k.K_7, k.K_8, k.K_9, k.K_0, k.K_HYPHEN, k.K_EQUAL ], + // [tab] Q W E R T Y U I O P [ ] + [ k.K_Q, k.K_W, k.K_E, k.K_R, k.K_T, k.K_Y, k.K_U, k.K_I, k.K_O, k.K_P, k.K_LBRKT, k.K_RBRKT ], + // [caps] A S D F G H J K L ; ' \ [enter] + [ k.K_A, k.K_S, k.K_D, k.K_F, k.K_G, k.K_H, k.K_J, k.K_K, k.K_L, k.K_COLON, k.K_QUOTE, k.K_BKSLASH ], // [shift] * Z X C V B N M , . / [shift] *=oE2 - [ k.K_oE2, k.K_Z, k.K_X, k.K_C, k.K_V, k.K_B, k.K_N, k.K_M, k.K_COMMA, k.K_PERIOD, k.K_SLASH ] + [ k.K_oE2, k.K_Z, k.K_X, k.K_C, k.K_V, k.K_B, k.K_N, k.K_M, k.K_COMMA, k.K_PERIOD, k.K_SLASH ], + // space + [ k.K_SPACE ], ]; /** @@ -194,4 +213,4 @@ export const LdmlVkeyNames: Record = { 'QUOTE': k.K_QUOTE, // 0xDE, // C11 'LESS-THAN': k.K_oE2, // 0xE2, // B00 102nd key on European layouts, right of left shift. 'ABNT2': k.k_oC1, // 0xC1, // B11 Extra key, left of right-shift, ABNT2 -}; \ No newline at end of file +}; diff --git a/core/tests/unit/ldml/keyboards/k_003_transform.xml b/core/tests/unit/ldml/keyboards/k_003_transform.xml index 1dcb003be1..decb9375a8 100644 --- a/core/tests/unit/ldml/keyboards/k_003_transform.xml +++ b/core/tests/unit/ldml/keyboards/k_003_transform.xml @@ -49,7 +49,6 @@ Note: keys should start with [K_A][K_B][K_C] not [K_Y] when transforms are funct - @@ -57,8 +56,8 @@ Note: keys should start with [K_A][K_B][K_C] not [K_Y] when transforms are funct - - + + diff --git a/core/tests/unit/ldml/keyboards/k_010_mt.xml b/core/tests/unit/ldml/keyboards/k_010_mt.xml new file mode 100644 index 0000000000..e123d12a7d --- /dev/null +++ b/core/tests/unit/ldml/keyboards/k_010_mt.xml @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/tests/unit/ldml/keyboards/meson.build b/core/tests/unit/ldml/keyboards/meson.build index 66857dfc80..80e2fa8edc 100644 --- a/core/tests/unit/ldml/keyboards/meson.build +++ b/core/tests/unit/ldml/keyboards/meson.build @@ -10,6 +10,10 @@ tests = [ 'k_001_tiny', 'k_002_tinyu32', 'k_003_transform', + 'k_010_mt', + 'k_100_keytest', + 'k_101_keytest', + 'k_102_keytest', ] # Setup kmc