mirror of
https://github.com/Eugeny/tabby.git
synced 2025-07-20 02:18:01 +00:00
@@ -85,9 +85,9 @@ export class XTermFrontend extends Frontend {
|
||||
this.xterm.unicode.activeVersion = '11'
|
||||
|
||||
const keyboardEventHandler = (name: string, event: KeyboardEvent) => {
|
||||
this.hotkeysService.pushKeystroke(name, event)
|
||||
this.hotkeysService.pushKeyEvent(name, event)
|
||||
let ret = true
|
||||
if (this.hotkeysService.getCurrentPartiallyMatchedHotkeys().length !== 0) {
|
||||
if (this.hotkeysService.matchActiveHotkey(true) !== null) {
|
||||
event.stopPropagation()
|
||||
event.preventDefault()
|
||||
ret = false
|
||||
|
@@ -100,15 +100,13 @@ export default class TerminalModule { // eslint-disable-line @typescript-eslint/
|
||||
events.forEach(event => {
|
||||
const oldHandler = hterm.hterm.Keyboard.prototype[event.htermHandler]
|
||||
hterm.hterm.Keyboard.prototype[event.htermHandler] = function (nativeEvent) {
|
||||
hotkeys.pushKeystroke(event.name, nativeEvent)
|
||||
if (hotkeys.getCurrentPartiallyMatchedHotkeys().length === 0) {
|
||||
hotkeys.pushKeyEvent(event.name, nativeEvent)
|
||||
if (hotkeys.matchActiveHotkey(true) !== null) {
|
||||
oldHandler.bind(this)(nativeEvent)
|
||||
} else {
|
||||
nativeEvent.stopPropagation()
|
||||
nativeEvent.preventDefault()
|
||||
}
|
||||
hotkeys.processKeystrokes()
|
||||
hotkeys.emitKeyEvent(nativeEvent)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user