mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
use KeyboardEvent.key instead of code (#4114)
This commit is contained in:
parent
b250a2f724
commit
a73f1507ba
2 changed files with 5 additions and 5 deletions
|
@ -166,7 +166,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
}
|
||||
|
||||
function onKeydown(event: KeyboardEvent): void {
|
||||
switch (event.code) {
|
||||
switch (event.key) {
|
||||
case "Enter":
|
||||
onEnter(event);
|
||||
break;
|
||||
|
|
|
@ -90,7 +90,7 @@ export function keyToPlatformString(key: string): string {
|
|||
}
|
||||
|
||||
export function isArrowLeft(event: KeyboardEvent): boolean {
|
||||
if (event.code === "ArrowLeft") {
|
||||
if (event.key === "ArrowLeft") {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -98,7 +98,7 @@ export function isArrowLeft(event: KeyboardEvent): boolean {
|
|||
}
|
||||
|
||||
export function isArrowRight(event: KeyboardEvent): boolean {
|
||||
if (event.code === "ArrowRight") {
|
||||
if (event.key === "ArrowRight") {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -106,7 +106,7 @@ export function isArrowRight(event: KeyboardEvent): boolean {
|
|||
}
|
||||
|
||||
export function isArrowUp(event: KeyboardEvent): boolean {
|
||||
if (event.code === "ArrowUp") {
|
||||
if (event.key === "ArrowUp") {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -114,7 +114,7 @@ export function isArrowUp(event: KeyboardEvent): boolean {
|
|||
}
|
||||
|
||||
export function isArrowDown(event: KeyboardEvent): boolean {
|
||||
if (event.code === "ArrowDown") {
|
||||
if (event.key === "ArrowDown") {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue