virtual-keypad 5.15.0 → 5.15.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/package.json +1 -1
- package/src/keypad.js +1 -1
- package/src/receiver.js +5 -1
package/package.json
CHANGED
package/src/keypad.js
CHANGED
|
@@ -293,7 +293,7 @@ class Keypad extends KeypadPeer {
|
|
|
293
293
|
// Add the label to the button
|
|
294
294
|
button.appendChild(buttonLabel);
|
|
295
295
|
// Add the labeled-button to the HTML
|
|
296
|
-
if (this.controlButtons.includes(symbol.
|
|
296
|
+
if (this.controlButtons.map(x => x.toLowerCase()).includes(symbol.toLowerCase())) {
|
|
297
297
|
document.querySelector("#keypad-control-keys").appendChild(button);
|
|
298
298
|
} else {
|
|
299
299
|
document.querySelector("#keypad-keys").appendChild(button);
|
package/src/receiver.js
CHANGED
|
@@ -60,7 +60,7 @@ class Receiver extends KeypadPeer {
|
|
|
60
60
|
this.peer.on("close", this.onClose);
|
|
61
61
|
this.peer.on("error", this.onError);
|
|
62
62
|
}
|
|
63
|
-
update = (alphabet = undefined, font = undefined) => {
|
|
63
|
+
update = (alphabet = undefined, font = undefined, controlButtons = undefined) => {
|
|
64
64
|
// Update alphabet
|
|
65
65
|
if (typeof alphabet !== "undefined") {
|
|
66
66
|
const validAlphabet = this.checkAlphabet(alphabet);
|
|
@@ -73,6 +73,8 @@ class Receiver extends KeypadPeer {
|
|
|
73
73
|
// TODO check if the font is supported, somehow
|
|
74
74
|
this.font = font ?? this.font; // Store new font
|
|
75
75
|
|
|
76
|
+
this.controlButtons = controlButtons ?? this.controlButtons;
|
|
77
|
+
|
|
76
78
|
// Update keypad
|
|
77
79
|
try {
|
|
78
80
|
this.conn.send({
|
|
@@ -80,6 +82,7 @@ class Receiver extends KeypadPeer {
|
|
|
80
82
|
alphabet: this.alphabet,
|
|
81
83
|
font: this.font,
|
|
82
84
|
peerID: this.peer.id,
|
|
85
|
+
controlButtons: this.controlButtons,
|
|
83
86
|
});
|
|
84
87
|
} catch (e) {
|
|
85
88
|
this.displayUpdate(
|
|
@@ -155,6 +158,7 @@ class Receiver extends KeypadPeer {
|
|
|
155
158
|
keypadParameters["alphabet"] = "Arial";
|
|
156
159
|
} else {
|
|
157
160
|
// FUTURE verify that the selected font is available
|
|
161
|
+
// TODO necessary to check control buttons?
|
|
158
162
|
}
|
|
159
163
|
return keypadParameters;
|
|
160
164
|
};
|