From 5757e24f32c30c62e42a13de2fce14c618b83ddd Mon Sep 17 00:00:00 2001 From: Amund Tenstad Date: Tue, 12 Nov 2024 06:39:02 +0100 Subject: [PATCH] feat: support all languages - not just selected --- src/store/keycodes.js | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/store/keycodes.js b/src/store/keycodes.js index aa5a562915..9713535986 100644 --- a/src/store/keycodes.js +++ b/src/store/keycodes.js @@ -13,7 +13,16 @@ import steno from './modules/keycodes/steno'; const keycodePickerTabLayout = { ANSI_ISO: [...ansi, ...iso_jis], ISO_ANSI: [...iso_jis, ...ansi], - special: [...quantum, ...settings, ...media] + special: [...quantum, ...settings, ...media], + extra: Object.values(keymapExtras) + .map(({ keycodeLUT }) => + Object.entries(keycodeLUT).map(([code, { name, title }]) => ({ + code: title?.split(' ')[0], // split removes ' (dead)' + name, + title: code + })) + ) + .flat() }; /** @@ -81,11 +90,7 @@ function generateKeycodes(osKeyboardLayout, isSteno = false) { ...keycodes.map((keycodeObject) => toLocaleKeycode(keycodeLUT, keycodeObject) ), - ...Object.entries(keycodeLUT).map(([code, { name, title }]) => ({ - code: title?.split(' ')[0], - name, - title: code - })) + ...keycodePickerTabLayout.extra ]; } @@ -125,7 +130,8 @@ export const useKeycodesStore = defineStore('keycodes', { state: () => ({ keycodes: [ ...keycodePickerTabLayout.ANSI_ISO, - ...keycodePickerTabLayout.special + ...keycodePickerTabLayout.special, + ...keycodePickerTabLayout.extra ], searchFilter: '', searchCounters: {