mirror of
https://github.com/Eugeny/tabby.git
synced 2025-09-06 08:31:54 +00:00
@@ -1,7 +1,7 @@
|
||||
import { Component, Input } from '@angular/core'
|
||||
import { trigger, transition, style, animate } from '@angular/animations'
|
||||
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
|
||||
import { HotkeysService, BaseComponent } from 'tabby-core'
|
||||
import { HotkeysService, BaseComponent, Keystroke } from 'tabby-core'
|
||||
|
||||
const INPUT_TIMEOUT = 1000
|
||||
|
||||
@@ -36,7 +36,7 @@ const INPUT_TIMEOUT = 1000
|
||||
],
|
||||
})
|
||||
export class HotkeyInputModalComponent extends BaseComponent {
|
||||
@Input() value: string[] = []
|
||||
@Input() value: Keystroke[] = []
|
||||
@Input() timeoutProgress = 0
|
||||
|
||||
private lastKeyEvent: number|null = null
|
||||
@@ -48,9 +48,9 @@ export class HotkeyInputModalComponent extends BaseComponent {
|
||||
) {
|
||||
super()
|
||||
this.hotkeys.clearCurrentKeystrokes()
|
||||
this.subscribeUntilDestroyed(hotkeys.key, (event) => {
|
||||
this.subscribeUntilDestroyed(hotkeys.keystroke$, (keystroke) => {
|
||||
this.lastKeyEvent = performance.now()
|
||||
this.value = this.hotkeys.getCurrentKeySequence().map(x => x.value)
|
||||
this.value.push(keystroke)
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
})
|
||||
|
Reference in New Issue
Block a user