support zimnego startu lokomotyw

This commit is contained in:
2023-07-13 17:51:09 +02:00
parent 7362d4ffbd
commit cbe983f96c
11 changed files with 108 additions and 81 deletions
+1 -3
View File
@@ -49,12 +49,10 @@ const sectionKeyIndexes: { [key: number]: SectionMode } = {
};
onMounted(() => {
console.log(sectionButtonRefs.value);
window.addEventListener('keydown', (e) => {
if (e.target instanceof HTMLInputElement) return;
if (e.key == '1' || e.key == '2' || e.key == '3' || e.key == '4') {
if (/[1234]/.test(e.key)) {
const keyNum = Number(e.key);
store.stockSectionMode = sectionKeyIndexes[keyNum];
(sectionButtonRefs.value[keyNum - 1] as HTMLButtonElement).focus();