1
0
mirror of https://github.com/hakimel/reveal.js.git synced 2025-08-05 14:17:56 +02:00

new controller for speaker notes

This commit is contained in:
Hakim El Hattab
2020-03-16 11:45:47 +01:00
parent 2b02f3a1f9
commit 97ee72549b
7 changed files with 180 additions and 144 deletions

View File

@@ -21,6 +21,32 @@ export default class Keyboard {
}
/**
* Called when the reveal.js config is updated.
*/
configure( config, oldConfig ) {
if( config.navigationMode === 'linear' ) {
this.shortcuts['→ , ↓ , SPACE , N , L , J'] = 'Next slide';
this.shortcuts['← , ↑ , P , H , K'] = 'Previous slide';
}
else {
this.shortcuts['N , SPACE'] = 'Next slide';
this.shortcuts['P'] = 'Previous slide';
this.shortcuts['← , H'] = 'Navigate left';
this.shortcuts['→ , L'] = 'Navigate right';
this.shortcuts['↑ , K'] = 'Navigate up';
this.shortcuts['↓ , J'] = 'Navigate down';
}
this.shortcuts['Home , Shift ←'] = 'First slide';
this.shortcuts['End , Shift →'] = 'Last slide';
this.shortcuts['B , .'] = 'Pause';
this.shortcuts['F'] = 'Fullscreen';
this.shortcuts['ESC, O'] = 'Slide overview';
}
/**
* Starts listening for keyboard events.
*/
@@ -73,32 +99,6 @@ export default class Keyboard {
}
/**
* Updates our keyboard shortcuts based on current settings.
*/
refreshSortcuts() {
if( this.Reveal.getConfig().navigationMode === 'linear' ) {
this.shortcuts['→ , ↓ , SPACE , N , L , J'] = 'Next slide';
this.shortcuts['← , ↑ , P , H , K'] = 'Previous slide';
}
else {
this.shortcuts['N , SPACE'] = 'Next slide';
this.shortcuts['P'] = 'Previous slide';
this.shortcuts['← , H'] = 'Navigate left';
this.shortcuts['→ , L'] = 'Navigate right';
this.shortcuts['↑ , K'] = 'Navigate up';
this.shortcuts['↓ , J'] = 'Navigate down';
}
this.shortcuts['Home , Shift ←'] = 'First slide';
this.shortcuts['End , Shift →'] = 'Last slide';
this.shortcuts['B , .'] = 'Pause';
this.shortcuts['F'] = 'Fullscreen';
this.shortcuts['ESC, O'] = 'Slide overview';
}
/**
* Programmatically triggers a keyboard event
*