Skip to content

Commit

Permalink
use KeyboardEvent code instead of key for multi language support (#58)
Browse files Browse the repository at this point in the history
Co-authored-by: Petr Kapsamun <petr.kapsamun@kaspersky.com>
  • Loading branch information
Creekmind and Petr Kapsamun committed Jun 26, 2021
1 parent a7817c6 commit 59da1f9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions codejar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -436,11 +436,11 @@ export function CodeJar(editor: HTMLElement, highlight: (e: HTMLElement, pos?: P
}

function isUndo(event: KeyboardEvent) {
return isCtrl(event) && !event.shiftKey && event.key === 'z'
return isCtrl(event) && !event.shiftKey && event.code === 'KeyZ'
}

function isRedo(event: KeyboardEvent) {
return isCtrl(event) && event.shiftKey && event.key === 'z'
return isCtrl(event) && event.shiftKey && event.code === 'KeyZ'
}

function insert(text: string) {
Expand Down

0 comments on commit 59da1f9

Please sign in to comment.