mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-11 15:10:02 +00:00
more hotkey fixes
This commit is contained in:
parent
08f1ad4c75
commit
eadd8d563e
@ -128,7 +128,7 @@ export class HotkeysService {
|
|||||||
|
|
||||||
const keyName = getKeyName(eventData)
|
const keyName = getKeyName(eventData)
|
||||||
if (eventName === 'keydown') {
|
if (eventName === 'keydown') {
|
||||||
this.addPressedKey(eventData)
|
this.addPressedKey(keyName, eventData)
|
||||||
this.shouldSaveNextKeystroke = true
|
this.shouldSaveNextKeystroke = true
|
||||||
this.updateModifiers(eventData)
|
this.updateModifiers(eventData)
|
||||||
}
|
}
|
||||||
@ -272,6 +272,9 @@ export class HotkeysService {
|
|||||||
if (!event[prop] && this.pressedKeys.has(key)) {
|
if (!event[prop] && this.pressedKeys.has(key)) {
|
||||||
this.removePressedKey(key)
|
this.removePressedKey(key)
|
||||||
}
|
}
|
||||||
|
if (event[prop] && !this.pressedKeys.has(key)) {
|
||||||
|
this.addPressedKey(key, event)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -324,8 +327,7 @@ export class HotkeysService {
|
|||||||
return keys
|
return keys
|
||||||
}
|
}
|
||||||
|
|
||||||
private addPressedKey (eventData: KeyEventData) {
|
private addPressedKey (keyName: KeyName, eventData: KeyEventData) {
|
||||||
const keyName = getKeyName(eventData)
|
|
||||||
this.pressedKeys.add(keyName)
|
this.pressedKeys.add(keyName)
|
||||||
this.pressedKeyTimestamps.set(keyName, eventData.registrationTime)
|
this.pressedKeyTimestamps.set(keyName, eventData.registrationTime)
|
||||||
}
|
}
|
||||||
|
@ -48,12 +48,14 @@ export class HotkeyInputModalComponent extends BaseComponent {
|
|||||||
) {
|
) {
|
||||||
super()
|
super()
|
||||||
this.hotkeys.clearCurrentKeystrokes()
|
this.hotkeys.clearCurrentKeystrokes()
|
||||||
this.subscribeUntilDestroyed(hotkeys.keystroke$, (keystroke) => {
|
this.subscribeUntilDestroyed(hotkeys.keyEvent$, event => {
|
||||||
this.lastKeyEvent = performance.now()
|
|
||||||
this.value.push(keystroke)
|
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
event.stopPropagation()
|
event.stopPropagation()
|
||||||
})
|
})
|
||||||
|
this.subscribeUntilDestroyed(hotkeys.keystroke$, keystroke => {
|
||||||
|
this.lastKeyEvent = performance.now()
|
||||||
|
this.value.push(keystroke)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
splitKeys (keys: string): string[] {
|
splitKeys (keys: string): string[] {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user