Added button hold support for arrow buttons. Fixes #548

This commit is contained in:
Francisco Hodge 2020-05-05 19:57:12 -04:00
parent eb0411d057
commit 2394510f92

View File

@ -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);