summaryrefslogtreecommitdiff
path: root/static/script.js
diff options
context:
space:
mode:
Diffstat (limited to 'static/script.js')
-rw-r--r--static/script.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/static/script.js b/static/script.js
index 9692f36..7585efa 100644
--- a/static/script.js
+++ b/static/script.js
@@ -167,6 +167,10 @@ function keyHandler(key) {
if (key == 'Backspace') {
el.innerText = '';
nextel = document.querySelector(`[data-offset="${offset-1}"]`);
+ } else if (key == 'ArrowLeft') {
+ nextel = document.querySelector(`[data-offset="${offset-1}"]`);
+ } else if (key == 'ArrowRight') {
+ nextel = document.querySelector(`[data-offset="${offset+1}"]`);
} else {
el.innerText = key.toUpperCase();
nextel = document.querySelector(`[data-offset="${offset+1}"]`);
@@ -184,7 +188,7 @@ document.addEventListener('keydown', function(e) {
// if (e.ctrlKey || e.altKey || (e.key.length != 1 && e.key != 'Backspace')) {
// return;
// }
- if (e.ctrlKey || e.altKey || (!"ABCDEFGHIJKLMNOPQRSTUVWXYZ".includes(e.key.toUpperCase()) && e.key != 'Backspace' && e.key != 'Enter')) {
+ if (e.ctrlKey || e.altKey || (!"ABCDEFGHIJKLMNOPQRSTUVWXYZ".includes(e.key.toUpperCase()) && e.key != 'Backspace' && e.key != 'Enter' && e.key != 'ArrowLeft' && e.key != 'ArrowRight')) {
return;
}
if (e.target.id == 'share') {