mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-16 01:19:58 +00:00
parent
95152456ce
commit
b664b9eed9
@ -130,9 +130,7 @@ export class HotkeysService {
|
|||||||
const keyName = getKeyName(eventData)
|
const keyName = getKeyName(eventData)
|
||||||
if (eventName === 'keydown') {
|
if (eventName === 'keydown') {
|
||||||
this.addPressedKey(keyName, eventData)
|
this.addPressedKey(keyName, eventData)
|
||||||
if (!nativeEvent.repeat) {
|
this.recognitionPhase = true
|
||||||
this.recognitionPhase = true
|
|
||||||
}
|
|
||||||
this.updateModifiers(eventData)
|
this.updateModifiers(eventData)
|
||||||
}
|
}
|
||||||
if (eventName === 'keyup') {
|
if (eventName === 'keyup') {
|
||||||
@ -158,8 +156,10 @@ export class HotkeysService {
|
|||||||
|
|
||||||
const matched = this.matchActiveHotkey()
|
const matched = this.matchActiveHotkey()
|
||||||
this.zone.run(() => {
|
this.zone.run(() => {
|
||||||
if (matched && this.recognitionPhase) {
|
if (matched) {
|
||||||
this.emitHotkeyOn(matched)
|
if (this.recognitionPhase) {
|
||||||
|
this.emitHotkeyOn(matched)
|
||||||
|
}
|
||||||
} else if (this.pressedHotkey) {
|
} else if (this.pressedHotkey) {
|
||||||
this.emitHotkeyOff(this.pressedHotkey)
|
this.emitHotkeyOff(this.pressedHotkey)
|
||||||
}
|
}
|
||||||
@ -288,10 +288,9 @@ export class HotkeysService {
|
|||||||
|
|
||||||
private emitHotkeyOn (hotkey: string) {
|
private emitHotkeyOn (hotkey: string) {
|
||||||
if (this.pressedHotkey) {
|
if (this.pressedHotkey) {
|
||||||
if (this.pressedHotkey === hotkey) {
|
if (this.pressedHotkey !== hotkey) {
|
||||||
return
|
this.emitHotkeyOff(this.pressedHotkey)
|
||||||
}
|
}
|
||||||
this.emitHotkeyOff(this.pressedHotkey)
|
|
||||||
}
|
}
|
||||||
if (document.querySelectorAll('input:focus').length === 0) {
|
if (document.querySelectorAll('input:focus').length === 0) {
|
||||||
console.debug('Matched hotkey', hotkey)
|
console.debug('Matched hotkey', hotkey)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user