Skip to content

Commit

Permalink
support numpad
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleoflqj committed Mar 5, 2023
1 parent 6e7cabb commit 73f109b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/MyPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ function onKeydown (e: KeyboardEvent) {
if (debugMode.value) {
return
}
const { key } = e
const { code, key } = e
const textarea = getTextarea(textareaSelector)
// begin: code specific to Android Chromium
if (key === 'Unidentified') {
Expand Down Expand Up @@ -197,7 +197,11 @@ function onKeydown (e: KeyboardEvent) {
const shifted = e.getModifierState('Shift')
let rimeKey: string | undefined
if (isPrintableKey) {
rimeKey = key
if (code.startsWith('Numpad')) {
rimeKey = `{KP_${code.substring(6)}}`
} else {
rimeKey = key
}
} else if (shifted && key === 'Delete') {
rimeKey = '{Shift+Delete}'
} else if (controlled && shifted && key === 'Enter') {
Expand Down

0 comments on commit 73f109b

Please sign in to comment.