summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--web/share/js/keypad.js16
1 files changed, 14 insertions, 2 deletions
diff --git a/web/share/js/keypad.js b/web/share/js/keypad.js
index 797a351e..5140ec8f 100644
--- a/web/share/js/keypad.js
+++ b/web/share/js/keypad.js
@@ -95,9 +95,21 @@ export function Keypad(__keys_parent, __sendKey, __apply_fixes) {
};
self.emitByKeyEvent = function(event, state) {
- if (!event.repeat) {
- self.emitByCode(event.code, state);
+ if (event.repeat) {
+ return;
}
+
+ let code = event.code;
+ if (__apply_fixes) {
+ // https://github.com/pikvm/pikvm/issues/819
+ if (code == "IntlBackslash" && event.key in ["`", "~"]) {
+ code = "Backquote";
+ } else if (code == "Backquote" && event.key in ["§", "±"]) {
+ code = "IntlBackslash";
+ }
+ }
+
+ self.emitByCode(code, state);
};
self.emitByCode = function(code, state, apply_fixes=true) {