mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-02-28 21:19:42 +00:00
Added player keyboard shortcuts
This commit is contained in:
parent
c3acd209bd
commit
8b130cb097
6 changed files with 39 additions and 11 deletions
|
|
@ -219,6 +219,7 @@ Each new feature or major change should be documented in an artifact specificati
|
|||
### Organization
|
||||
|
||||
- **Location**: All artifact specifications are stored in the `artifacts/` directory.
|
||||
- **Index**: You can look up previous artifact specification files in `artifacts/index.md`.
|
||||
- **Dated Folders**: Specifications **MUST** be placed in a subfolder named by the current date (e.g., `artifacts/YYYY-MM-DD/`).
|
||||
- **CRITICAL**: Do **NOT** create specification files directly in the `artifacts/` root. Always use the dated folder.
|
||||
- **Filename**: Use descriptive names for the specification files (e.g., `move-to-library-specification.md`).
|
||||
|
|
|
|||
|
|
@ -28,6 +28,13 @@ To improve the efficiency of batch operations, global keyboard listeners have be
|
|||
- **Collections**: `Alt + C`.
|
||||
- **Authors**: `Alt + A`.
|
||||
|
||||
- **Audio Player Shortcuts**:
|
||||
- **Jump Forward**: `Shift + Right Arrow` (Standard), `Ctrl + Shift + Right Arrow` (Major, 60s).
|
||||
- **Jump Backward**: `Shift + Left Arrow` (Standard), `Ctrl + Shift + Left Arrow` (Major, 60s).
|
||||
- **Next Chapter**: `Shift + Up Arrow`.
|
||||
- **Previous Chapter**: `Shift + Down Arrow`.
|
||||
- **Playback Rate**: `]` (Increase), `[` (Decrease).
|
||||
|
||||
- **Modal & Prompt Controls**:
|
||||
- **Confirm / Submit**: `Enter` (Works on confirmation prompts and many action modals like "Move", "Quick Match", and "Split").
|
||||
- **Cancel / Close**: `Escape` (Closes modals, cancels prompts, and clears batch selections).
|
||||
|
|
|
|||
|
|
@ -203,6 +203,12 @@ export default {
|
|||
jumpForward() {
|
||||
this.$emit('jumpForward')
|
||||
},
|
||||
jumpBackwardMajor() {
|
||||
this.seek(Math.max(this.currentTime - 60, 0))
|
||||
},
|
||||
jumpForwardMajor() {
|
||||
this.seek(Math.min(this.currentTime + 60, this.duration))
|
||||
},
|
||||
increaseVolume() {
|
||||
if (this.volume >= 1) return
|
||||
this.volume = Math.min(1, this.volume + 0.1)
|
||||
|
|
@ -343,8 +349,12 @@ export default {
|
|||
},
|
||||
hotkey(action) {
|
||||
if (action === this.$hotkeys.AudioPlayer.PLAY_PAUSE) this.playPause()
|
||||
else if (action === this.$hotkeys.AudioPlayer.JUMP_FORWARD) this.jumpForward()
|
||||
else if (action === this.$hotkeys.AudioPlayer.JUMP_BACKWARD) this.jumpBackward()
|
||||
else if (action === this.$hotkeys.AudioPlayer.JUMP_FORWARD || action === this.$hotkeys.AudioPlayer.JUMP_FORWARD_ALT) this.jumpForward()
|
||||
else if (action === this.$hotkeys.AudioPlayer.JUMP_BACKWARD || action === this.$hotkeys.AudioPlayer.JUMP_BACKWARD_ALT) this.jumpBackward()
|
||||
else if (action === this.$hotkeys.AudioPlayer.JUMP_FORWARD_MAJOR) this.jumpForwardMajor()
|
||||
else if (action === this.$hotkeys.AudioPlayer.JUMP_BACKWARD_MAJOR) this.jumpBackwardMajor()
|
||||
else if (action === this.$hotkeys.AudioPlayer.NEXT_CHAPTER) this.goToNext()
|
||||
else if (action === this.$hotkeys.AudioPlayer.PREV_CHAPTER) this.prevChapter()
|
||||
else if (action === this.$hotkeys.AudioPlayer.VOLUME_UP) this.increaseVolume()
|
||||
else if (action === this.$hotkeys.AudioPlayer.VOLUME_DOWN) this.decreaseVolume()
|
||||
else if (action === this.$hotkeys.AudioPlayer.MUTE_UNMUTE) this.toggleMute()
|
||||
|
|
|
|||
|
|
@ -531,9 +531,10 @@ export default {
|
|||
return null
|
||||
}
|
||||
|
||||
var keyName = this.$keynames[keyCode]
|
||||
var name = keyName
|
||||
if (e.shiftKey) name = 'Shift-' + keyName
|
||||
var name = this.$keynames[keyCode]
|
||||
if (e.ctrlKey || e.metaKey) name = 'Ctrl-' + name
|
||||
if (e.altKey) name = 'Alt-' + name
|
||||
if (e.shiftKey) name = 'Shift-' + name
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
console.log('Hotkey command', name)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -314,9 +314,10 @@ export default {
|
|||
return null
|
||||
}
|
||||
|
||||
var keyName = this.$keynames[keyCode]
|
||||
var name = keyName
|
||||
if (e.shiftKey) name = 'Shift-' + keyName
|
||||
var name = this.$keynames[keyCode]
|
||||
if (e.ctrlKey || e.metaKey) name = 'Ctrl-' + name
|
||||
if (e.altKey) name = 'Alt-' + name
|
||||
if (e.shiftKey) name = 'Shift-' + name
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
console.log('Hotkey command', name)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,19 +64,27 @@ const KeyNames = {
|
|||
81: 'KeyQ',
|
||||
82: 'KeyR',
|
||||
83: 'KeyS',
|
||||
191: 'Slash'
|
||||
191: 'Slash',
|
||||
219: 'BracketLeft',
|
||||
221: 'BracketRight'
|
||||
}
|
||||
const Hotkeys = {
|
||||
AudioPlayer: {
|
||||
PLAY_PAUSE: 'Space',
|
||||
JUMP_FORWARD: 'ArrowRight',
|
||||
JUMP_BACKWARD: 'ArrowLeft',
|
||||
JUMP_FORWARD_ALT: 'Shift-ArrowRight',
|
||||
JUMP_BACKWARD_ALT: 'Shift-ArrowLeft',
|
||||
JUMP_FORWARD_MAJOR: 'Shift-Ctrl-ArrowRight',
|
||||
JUMP_BACKWARD_MAJOR: 'Shift-Ctrl-ArrowLeft',
|
||||
VOLUME_UP: 'ArrowUp',
|
||||
VOLUME_DOWN: 'ArrowDown',
|
||||
MUTE_UNMUTE: 'KeyM',
|
||||
SHOW_CHAPTERS: 'KeyL',
|
||||
INCREASE_PLAYBACK_RATE: 'Shift-ArrowUp',
|
||||
DECREASE_PLAYBACK_RATE: 'Shift-ArrowDown',
|
||||
NEXT_CHAPTER: 'Shift-ArrowUp',
|
||||
PREV_CHAPTER: 'Shift-ArrowDown',
|
||||
INCREASE_PLAYBACK_RATE: 'BracketRight',
|
||||
DECREASE_PLAYBACK_RATE: 'BracketLeft',
|
||||
CLOSE: 'Escape'
|
||||
},
|
||||
EReader: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue