* Keyboard Shortcuts table: Dynamically fill object at configuration
This commit is contained in:
parent
1efb8260af
commit
bb4eeb6c3c
35
js/reveal.js
35
js/reveal.js
@ -361,20 +361,8 @@
|
|||||||
threshold: 40
|
threshold: 40
|
||||||
},
|
},
|
||||||
|
|
||||||
// Holds information about the keyboard shortcuts
|
// Holds information about the keyboard shortcuts (filled in on configuration).
|
||||||
keyboardShortcuts = {
|
keyboardShortcuts = {},
|
||||||
'N , SPACE': 'Next slide',
|
|
||||||
'P': 'Previous slide',
|
|
||||||
'← , H': 'Navigate left',
|
|
||||||
'→ , L': 'Navigate right',
|
|
||||||
'↑ , K': 'Navigate up',
|
|
||||||
'↓ , J': 'Navigate down',
|
|
||||||
'Home , ⌘/CTRL ←': 'First slide',
|
|
||||||
'End , ⌘/CTRL →': 'Last slide',
|
|
||||||
'B , .': 'Pause',
|
|
||||||
'F': 'Fullscreen',
|
|
||||||
'ESC, O': 'Slide overview'
|
|
||||||
},
|
|
||||||
|
|
||||||
// Holds custom key code mappings
|
// Holds custom key code mappings
|
||||||
registeredKeyBindings = {};
|
registeredKeyBindings = {};
|
||||||
@ -1386,6 +1374,25 @@
|
|||||||
dom.wrapper.removeAttribute( 'data-navigation-mode' );
|
dom.wrapper.removeAttribute( 'data-navigation-mode' );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if( config.navigationMode === 'linear' ) {
|
||||||
|
keyboardShortcuts['N , SPACE , → , L , ↓ , J'] = 'Next slide';
|
||||||
|
keyboardShortcuts['P , ← , H , ↑ , K'] = 'Previous slide';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
keyboardShortcuts['N , SPACE'] = 'Next slide';
|
||||||
|
keyboardShortcuts['P'] = 'Previous slide';
|
||||||
|
keyboardShortcuts['← , H'] = 'Navigate left';
|
||||||
|
keyboardShortcuts['→ , L'] = 'Navigate right';
|
||||||
|
keyboardShortcuts['↑ , K'] = 'Navigate up';
|
||||||
|
keyboardShortcuts['↓ , J'] = 'Navigate down';
|
||||||
|
}
|
||||||
|
keyboardShortcuts['Home , ⌘/CTRL ←'] = 'First slide';
|
||||||
|
keyboardShortcuts['End , ⌘/CTRL →'] = 'Last slide';
|
||||||
|
keyboardShortcuts['B , .'] = 'Pause';
|
||||||
|
keyboardShortcuts['F'] = 'Fullscreen';
|
||||||
|
keyboardShortcuts['ESC, O'] = 'Slide overview';
|
||||||
|
|
||||||
sync();
|
sync();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user