summaryrefslogtreecommitdiff
path: root/static/script.js
diff options
context:
space:
mode:
authorcyfraeviolae <cyfraeviolae>2022-02-26 02:09:17 -0500
committercyfraeviolae <cyfraeviolae>2022-02-26 02:09:17 -0500
commitd7683c7f82ff87171bf17192866f8a6a47185b14 (patch)
treecd79e4dd87df5d579f9508b976abfc96d59c8419 /static/script.js
parentb2f8387cb4be4e2ab0febd5185a0df6f990bbbd4 (diff)
arrows
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') {