Use key instead of code in type-in field (#3166)
* Use key instead of code in type-in field * Use event.key for Enter
This commit is contained in:
parent
22ecab1a0e
commit
573af9cd4c
@ -116,7 +116,7 @@ function useInputHandler(): [InputHandlerAPI, SetupInputHandlerAction] {
|
||||
specialKey.dispatch({ event, action: "caretRight" });
|
||||
} else if (isArrowLeft(event)) {
|
||||
specialKey.dispatch({ event, action: "caretLeft" });
|
||||
} else if (event.code === "Enter" || event.code === "NumpadEnter") {
|
||||
} else if (event.key === "Enter") {
|
||||
specialKey.dispatch({ event, action: "enter" });
|
||||
} else if (event.code === "Tab") {
|
||||
specialKey.dispatch({ event, action: "tab" });
|
||||
|
@ -222,8 +222,8 @@ export function _drawMark(mark: boolean): void {
|
||||
}
|
||||
|
||||
export function _typeAnsPress(): void {
|
||||
const code = (window.event as KeyboardEvent).code;
|
||||
if (["Enter", "NumpadEnter"].includes(code)) {
|
||||
const key = (window.event as KeyboardEvent).key;
|
||||
if (key === "Enter") {
|
||||
bridgeCommand("ans");
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user