diff --git a/screen.js b/screen.js index a360172f..a38f8280 100644 --- a/screen.js +++ b/screen.js @@ -3165,6 +3165,7 @@ const EDITOR_SHORTCUT_COMMANDS = Object.freeze([ { id: 'setFretTen', label: 'Set selected fret 10', group: 'Notes', status: 'ready', keys: { feedback: 'Shift+0', eof: 'Shift+0' } }, { id: 'noteMenu', label: 'Open note edit menu', group: 'Notes', status: 'ready', keys: { feedback: '', eof: 'N' } }, { id: 'bend', label: 'Edit bend', group: 'Notes', status: 'ready', keys: { feedback: 'B', eof: 'Ctrl+B' } }, + { id: 'slideEditor', label: 'Edit pitched slide', group: 'Notes', status: 'ready', keys: { feedback: 'S', eof: 'S' } }, { id: 'unpitchedSlide', label: 'Edit unpitched slide', group: 'Notes', status: 'ready', keys: { feedback: 'U', eof: 'Ctrl+U' } }, { id: 'moveStringUp', label: 'Move selection up one string', group: 'Notes', status: 'ready', keys: { feedback: 'Up', eof: 'Up' } }, { id: 'moveStringDown', label: 'Move selection down one string', group: 'Notes', status: 'ready', keys: { feedback: 'Down', eof: 'Down' } }, @@ -3275,6 +3276,7 @@ function _editorEofCommandForKeyPure(e, mode) { if (shift && key === ')') return 'setFretTen'; if (plain && key === 'h') return 'toggleHammerOn'; if (plain && key === 'p') return 'togglePullOff'; + if (plain && key === 's') return 'slideEditor'; if (plain && key === 'n') return 'noteMenu'; if (plain && key === 't') return 'toggleTap'; if (shift && key === 'f') return 'setAnchor'; @@ -3377,6 +3379,7 @@ function _editorFeedbackCommandForKeyPure(e, mode) { if (plain && /^[0-9]$/.test(key)) return 'setFretDigit:' + key; if (shift && key === ')') return 'setFretTen'; if (plain && key === 'b') return 'bend'; + if (plain && key === 's') return 'slideEditor'; if (plain && key === 'u') return 'unpitchedSlide'; if (plain && e.key === 'ArrowUp') return 'moveStringUp'; if (plain && e.key === 'ArrowDown') return 'moveStringDown'; @@ -3925,6 +3928,7 @@ function _editorRunEofCommand(cmd) { case 'setFretTen': return _editorSetSelectedFret(10); case 'noteMenu': { const idxs = _editorCurrentNoteIndices(); if (idxs.length) showContextMenu(window.innerWidth / 2, window.innerHeight / 2, idxs[0]); else setStatus('Select a note first'); return true; } case 'bend': { const idxs = _editorCurrentNoteIndices(); if (idxs.length) promptBend(idxs[0]); else setStatus('Select a note first'); return true; } + case 'slideEditor': { const idxs = _editorCurrentNoteIndices(); if (idxs.length) promptSlide(idxs[0]); else setStatus('Select a note first'); return true; } case 'unpitchedSlide': { const idxs = _editorCurrentNoteIndices(); if (idxs.length) promptSlideUnpitch(idxs[0]); else setStatus('Select a note first'); return true; } case 'moveStringUp': return _execMoveStringSameFret(+1); case 'moveStringDown': return _execMoveStringSameFret(-1); diff --git a/tests/eof_shortcuts.test.js b/tests/eof_shortcuts.test.js index 3b4b0bb8..8892844b 100644 --- a/tests/eof_shortcuts.test.js +++ b/tests/eof_shortcuts.test.js @@ -91,6 +91,7 @@ t('exposes ready and planned shortcut command rows', () => { assert.strictEqual(rows.find(r => r.id === 'moveStringUp').key, 'Up'); assert.strictEqual(rows.find(r => r.id === 'moveStringDown').key, 'Down'); assert.strictEqual(rows.find(r => r.id === 'toggleSlap').key, 'Shift+O'); + assert.strictEqual(rows.find(r => r.id === 'slideEditor').key, 'S'); assert.strictEqual(rows.find(r => r.id === 'setTimeSignature').key, 'Shift+T / Shift+I'); assert.strictEqual(rows.find(r => r.id === 'tempoBeatCount').key, 'N (Tempo Map)'); assert.strictEqual(rows.find(r => r.id === 'tempoBeatMinus').key, '[ (Tempo Map)'); @@ -112,6 +113,7 @@ t('exposes wired FeedBack Native key labels', () => { assert.strictEqual(rows.find(r => r.id === 'moveStringUp').key, 'Up'); assert.strictEqual(rows.find(r => r.id === 'moveStringDown').key, 'Down'); assert.strictEqual(rows.find(r => r.id === 'toggleSlap').key, 'Shift+O'); + assert.strictEqual(rows.find(r => r.id === 'slideEditor').key, 'S'); assert.strictEqual(rows.find(r => r.id === 'importGp').key, ''); assert.strictEqual(rows.find(r => r.id === 'toggleTempoMap').key, 'T'); assert.strictEqual(rows.find(r => r.id === 'tempoBeatCount').key, 'N (Tempo Map)'); @@ -142,6 +144,7 @@ t('maps FeedBack Native note and technique shortcuts', () => { assert.strictEqual(api._editorFeedbackCommandForKeyPure(ev('ArrowUp', { shift: true })), 'transposeStringUp'); assert.strictEqual(api._editorFeedbackCommandForKeyPure(ev('t')), 'toggleTempoMap'); assert.strictEqual(api._editorFeedbackCommandForKeyPure(ev('b')), 'bend'); + assert.strictEqual(api._editorFeedbackCommandForKeyPure(ev('s')), 'slideEditor'); assert.strictEqual(api._editorFeedbackCommandForKeyPure(ev('h')), 'toggleHammerOn'); assert.strictEqual(api._editorFeedbackCommandForKeyPure(ev('n')), 'toggleNaturalHarmonic'); assert.strictEqual(api._editorFeedbackCommandForKeyPure(ev('n', { shift: true })), 'togglePinchHarmonic'); @@ -170,6 +173,7 @@ t('maps FeedBack Native Tempo Map commands by active mode', () => { t('maps EOF Tempo Map commands by active mode', () => { assert.strictEqual(api._editorEofCommandForKeyPure(ev('t')), 'toggleTap'); + assert.strictEqual(api._editorEofCommandForKeyPure(ev('s')), 'slideEditor'); assert.strictEqual(api._editorEofCommandForKeyPure(ev('4')), 'setFretDigit:4'); assert.strictEqual(api._editorEofCommandForKeyPure(ev(')', { shift: true })), 'setFretTen'); assert.strictEqual(api._editorEofCommandForKeyPure(ev('ArrowUp')), 'moveStringUp');