Skip to content

Commit

Permalink
feat: support all languages - not just selected
Browse files Browse the repository at this point in the history
  • Loading branch information
tenstad committed Nov 12, 2024
1 parent ac2f809 commit 5757e24
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/store/keycodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
};

/**
Expand Down Expand Up @@ -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
];
}

Expand Down Expand Up @@ -125,7 +130,8 @@ export const useKeycodesStore = defineStore('keycodes', {
state: () => ({
keycodes: [
...keycodePickerTabLayout.ANSI_ISO,
...keycodePickerTabLayout.special
...keycodePickerTabLayout.special,
...keycodePickerTabLayout.extra
],
searchFilter: '',
searchCounters: {
Expand Down

0 comments on commit 5757e24

Please sign in to comment.