Summary Files Commits Branches @commit @diff @stats
path: root / src / scripts / presentation.js
diff options
context:
space:
mode:
Commit25a63dd10cc09f18a8aa07cee74e6591a0c0381f (patch)
Author
 Syndamia <kamen@syndamia.com>
2023-04-28 17:32:45 +0300
Committer
 Syndamia <kamen@syndamia.com>
2023-04-28 17:32:45 +0300
Files67291ec4ec706a0230762b78bd5d5561d9adf7e9 /src/scripts/presentation.js
syndamia.com-25a63dd10cc09f18a8aa07cee74e6591a0c0381f.tar
syndamia.com-25a63dd10cc09f18a8aa07cee74e6591a0c0381f.tar.gz
syndamia.com-25a63dd10cc09f18a8aa07cee74e6591a0c0381f.zip
Parentc6569f29f38627d553531f85cf5ea71cae23f897 (diff)
[keyboard.js] Moved all keybindings to a separate javascript file and implemented vim-like navigation for headings
1 files changed, 0 insertions, 37 deletions
-rw-r--r--src/scripts/presentation.js37
diff --git a/src/scripts/presentation.js b/src/scripts/presentation.js
index 70339e6..425815c 100644
--- a/src/scripts/presentation.js
+++ b/src/scripts/presentation.js
@@ -102,40 +102,3 @@ articleBtn.addEventListener('click', function() {
// Toggle presentation.css
document.styleSheets.item(3).disabled = !document.styleSheets.item(3).disabled;
});
-
-/* Keyboard controls */
-
-document.addEventListener('keydown', function (e) {
- if (e.ctrlKey) return;
-
- switch (e.code) {
- // Previous slide
- case 'Backspace': case 'PageUp':
- case 'KeyK': case 'KeyH':
- case 'ArrowLeft': case 'ArrowUp':
- showSlide(-1);
- break;
- // Next slide
- case 'Space': case 'Enter': case 'PageDown':
- case 'KeyJ': case 'KeyL':
- case 'ArrowRight': case 'ArrowDown':
- showSlide(+1);
- break;
- // Start (toggle) presenting
- case 'KeyP': case 'KeyT':
- presentBtn.click();
- break;
- // Exit presentation
- case 'Escape':
- if (presenting) presentBtn.click();
- break;
- // Go to first slide
- case 'Home':
- showSlide(-slideIndex);
- break;
- // Go to last slide
- case 'End':
- showSlide(-slideIndex -1);
- break;
- }
-});