Skip to content

Commit

Permalink
Do not require autoSeek to use keyboard shortcuts
Browse files Browse the repository at this point in the history
  • Loading branch information
warmans committed Feb 9, 2024
1 parent ec2feac commit 2426d33
Showing 1 changed file with 24 additions and 26 deletions.
50 changes: 24 additions & 26 deletions gui/src/app/module/shared/component/editor/editor.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,33 +121,31 @@ export class EditorComponent implements OnInit, OnDestroy {

@HostListener('document:keydown', ['$event'])
handleKeyboardEvent(event: KeyboardEvent): boolean {
if (this._editorConfig.autoSeek === undefined ? true : this._editorConfig.autoSeek) {
if (this._editorConfig?.playPauseKey && event.key === (this._editorConfig?.playPauseKey)) {
this.audioService.toggleAudio(0 - (this._editorConfig?.backtrack || 3));
return false;
}
if (this._editorConfig?.rewindKey && event.key === (this._editorConfig?.rewindKey)) {
this.skipBackwards();
return false;
}
if (this._editorConfig?.fastForwardKey && event.key === (this._editorConfig?.fastForwardKey)) {
this.skipForward();
return false;
}
if (this._editorConfig?.fastForwardKey && event.key === (this._editorConfig?.fastForwardKey)) {
this.skipForward();
return false;
}
if (this._editorConfig?.insertOffsetKey && event.key === (this._editorConfig?.insertOffsetKey)) {
this.insertOffsetAboveCaret();
return false;
}
if (this._editorConfig?.insertSynKey && event.key === (this._editorConfig?.insertSynKey)) {
this.insertSynAboveCaret();
return false;
}
return true;
if (this._editorConfig?.playPauseKey && event.key === (this._editorConfig?.playPauseKey)) {
this.audioService.toggleAudio(0 - (this._editorConfig?.backtrack || 3));
return false;
}
if (this._editorConfig?.rewindKey && event.key === (this._editorConfig?.rewindKey)) {
this.skipBackwards();
return false;
}
if (this._editorConfig?.fastForwardKey && event.key === (this._editorConfig?.fastForwardKey)) {
this.skipForward();
return false;
}
if (this._editorConfig?.fastForwardKey && event.key === (this._editorConfig?.fastForwardKey)) {
this.skipForward();
return false;
}
if (this._editorConfig?.insertOffsetKey && event.key === (this._editorConfig?.insertOffsetKey)) {
this.insertOffsetAboveCaret();
return false;
}
if (this._editorConfig?.insertSynKey && event.key === (this._editorConfig?.insertSynKey)) {
this.insertSynAboveCaret();
return false;
}
return true;
}

constructor(private audioService: AudioService, private cdr: ChangeDetectorRef) {
Expand Down

0 comments on commit 2426d33

Please sign in to comment.