From 2394510f9276d02828fe8825c9e540196bf40101 Mon Sep 17 00:00:00 2001 From: Francisco Hodge Date: Tue, 5 May 2020 19:57:12 -0400 Subject: [PATCH] Added button hold support for arrow buttons. Fixes #548 --- src/lib/components/Keyboard.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib/components/Keyboard.js b/src/lib/components/Keyboard.js index b79d7601..f096f423 100644 --- a/src/lib/components/Keyboard.js +++ b/src/lib/components/Keyboard.js @@ -330,12 +330,17 @@ class SimpleKeyboard { this.holdTimeout = setTimeout(() => { if ( this.isMouseHold && + // TODO: This needs to be configurable through options ((!button.includes("{") && !button.includes("}")) || button === "{delete}" || button === "{backspace}" || button === "{bksp}" || button === "{space}" || - button === "{tab}") + button === "{tab}") || + button === "{arrowright}" || + button === "{arrowleft}" || + button === "{arrowup}" || + button === "{arrowdown}" ) { if (this.options.debug) console.log("Button held:", button);