mirror of
https://github.com/vale981/tridactyl
synced 2025-03-04 17:11:40 -05:00
Move common keyboardEvent stopping logic into KeyCanceller
This commit is contained in:
parent
270aafb5f5
commit
3f252ddf45
1 changed files with 2 additions and 4 deletions
|
@ -65,6 +65,8 @@ class KeyCanceller {
|
|||
}
|
||||
|
||||
push(ke: KeyboardEvent) {
|
||||
ke.preventDefault()
|
||||
ke.stopImmediatePropagation()
|
||||
this.keyPress.push(ke)
|
||||
this.keyUp.push(ke)
|
||||
}
|
||||
|
@ -196,8 +198,6 @@ function* ParserController() {
|
|||
)
|
||||
|
||||
if (response.isMatch && keyevent instanceof KeyboardEvent) {
|
||||
keyevent.preventDefault()
|
||||
keyevent.stopImmediatePropagation()
|
||||
canceller.push(keyevent)
|
||||
}
|
||||
|
||||
|
@ -241,8 +241,6 @@ export function acceptKey(keyevent: KeyboardEvent) {
|
|||
bufferedPageKeys.push(keyevent.key);
|
||||
logger.debug("Buffering page keys", bufferedPageKeys)
|
||||
}
|
||||
keyevent.preventDefault()
|
||||
keyevent.stopImmediatePropagation()
|
||||
canceller.push(keyevent)
|
||||
}
|
||||
logger.debug("controller_content mustBufferPageKeysForClInput = " + mustBufferPageKeysForClInput)
|
||||
|
|
Loading…
Add table
Reference in a new issue