From 25c002f70e41d8e0231b548f03c3a9abe9f7f70c Mon Sep 17 00:00:00 2001 From: Lumi Pakkanen Date: Wed, 3 Jan 2024 14:29:30 +0200 Subject: [PATCH] Split isomorphic QWERTY code to a re-usable package ref #336 --- package-lock.json | 10 + package.json | 1 + src/App.vue | 2 +- src/components/VirtualTypingKeyboard.vue | 4 +- src/keyboard-mapping.ts | 2 +- src/keyboard.ts | 315 ----------------------- src/views/VirtualQwerty.vue | 2 +- 7 files changed, 16 insertions(+), 320 deletions(-) delete mode 100644 src/keyboard.ts diff --git a/package-lock.json b/package-lock.json index a8f49eef..8839c954 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,6 +8,7 @@ "name": "scale-workshop", "version": "2.3.2", "dependencies": { + "isomorphic-qwerty": "^0.0.2", "jszip": "^3.10.1", "moment-of-symmetry": "^0.3.3", "pinia": "^2.1.7", @@ -4168,6 +4169,15 @@ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true }, + "node_modules/isomorphic-qwerty": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/isomorphic-qwerty/-/isomorphic-qwerty-0.0.2.tgz", + "integrity": "sha512-V4uQnMAy5P5lGAQ+AXcoCG+QeQQg5MfYh2lfNexA2Zmi0U+ikMZGlcBOHGHbAyqtsAFK2APrzIWLy6L1jJElrA==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/frostburn" + } + }, "node_modules/isstream": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", diff --git a/package.json b/package.json index 379d49e3..2aaea7fb 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "format": "prettier --write src/" }, "dependencies": { + "isomorphic-qwerty": "^0.0.2", "jszip": "^3.10.1", "moment-of-symmetry": "^0.3.3", "pinia": "^2.1.7", diff --git a/src/App.vue b/src/App.vue index fd5454b6..49371c5c 100644 --- a/src/App.vue +++ b/src/App.vue @@ -12,7 +12,7 @@ import { ScaleWorkshopOneData } from '@/scale-workshop-one' import type { Input, Output } from 'webmidi' import { computeWhiteIndices } from '@/midi' import { MidiIn, midiKeyInfo, MidiOut } from 'xen-midi' -import { Keyboard, type CoordinateKeyboardEvent } from '@/keyboard' +import { Keyboard, type CoordinateKeyboardEvent } from 'isomorphic-qwerty' import { decodeQuery, encodeQuery, type DecodedState } from '@/url-encode' import { debounce } from '@/utils' import { version } from '../package.json' diff --git a/src/components/VirtualTypingKeyboard.vue b/src/components/VirtualTypingKeyboard.vue index c02af3f7..4d8eebfc 100644 --- a/src/components/VirtualTypingKeyboard.vue +++ b/src/components/VirtualTypingKeyboard.vue @@ -1,8 +1,8 @@