Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions screen.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' } },
Expand Down Expand Up @@ -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';
Expand Down Expand Up @@ -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';
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 4 additions & 0 deletions tests/eof_shortcuts.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)');
Expand All @@ -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)');
Expand Down Expand Up @@ -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');
Expand Down Expand Up @@ -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');
Expand Down