mirror of
https://github.com/hodgef/simple-keyboard.git
synced 2025-02-22 01:29:39 +08:00
Added button hold support for arrow buttons. Fixes #548
This commit is contained in:
parent
eb0411d057
commit
2394510f92
@ -330,12 +330,17 @@ class SimpleKeyboard {
|
|||||||
this.holdTimeout = setTimeout(() => {
|
this.holdTimeout = setTimeout(() => {
|
||||||
if (
|
if (
|
||||||
this.isMouseHold &&
|
this.isMouseHold &&
|
||||||
|
// TODO: This needs to be configurable through options
|
||||||
((!button.includes("{") && !button.includes("}")) ||
|
((!button.includes("{") && !button.includes("}")) ||
|
||||||
button === "{delete}" ||
|
button === "{delete}" ||
|
||||||
button === "{backspace}" ||
|
button === "{backspace}" ||
|
||||||
button === "{bksp}" ||
|
button === "{bksp}" ||
|
||||||
button === "{space}" ||
|
button === "{space}" ||
|
||||||
button === "{tab}")
|
button === "{tab}") ||
|
||||||
|
button === "{arrowright}" ||
|
||||||
|
button === "{arrowleft}" ||
|
||||||
|
button === "{arrowup}" ||
|
||||||
|
button === "{arrowdown}"
|
||||||
) {
|
) {
|
||||||
if (this.options.debug) console.log("Button held:", button);
|
if (this.options.debug) console.log("Button held:", button);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user