Skip to content

Commit

Permalink
adjust remote repeat keys
Browse files Browse the repository at this point in the history
  • Loading branch information
iBicha committed Nov 16, 2023
1 parent f8d202b commit cf17fed
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions playlet-web/src/lib/Screens/RemoteControlScreen.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -71,29 +71,33 @@
});
function onKeyDown(event) {
if (!visibility || event.repeat) {
if (!visibility) {
return;
}
event.preventDefault();
if (event.repeat) {
return;
}
if (event.key in KEYBOARD_BUTTONS) {
event.preventDefault();
ExternalControlProtocol.pressKeyDown(KEYBOARD_BUTTONS[event.key]);
} else {
event.preventDefault();
ExternalControlProtocol.pressKeyDown(
"Lit_" + encodeURIComponent(event.key)
);
}
}
function onKeyUp(event) {
if (!visibility || event.repeat) {
if (!visibility) {
return;
}
event.preventDefault();
if (event.repeat) {
return;
}
if (event.key in KEYBOARD_BUTTONS) {
event.preventDefault();
ExternalControlProtocol.pressKeyUp(KEYBOARD_BUTTONS[event.key]);
} else {
event.preventDefault();
ExternalControlProtocol.pressKeyUp(
"Lit_" + encodeURIComponent(event.key)
);
Expand Down

0 comments on commit cf17fed

Please sign in to comment.