diff options
author | Maxim Devaev <[email protected]> | 2022-12-10 18:19:36 +0300 |
---|---|---|
committer | Maxim Devaev <[email protected]> | 2022-12-10 18:19:36 +0300 |
commit | d683149b38742dba05fa7d33e2e76f8e4c64d7a6 (patch) | |
tree | b48e8aac3360909a602b92e116117b36451e5559 | |
parent | 392b8c3f9e76213cafa92e1e1b3c1b20cafd1834 (diff) |
pikvm/pikvm#878: Added Japanese keys
-rw-r--r-- | hid/lib/drivers-avr/ps2/keymap.h | 4 | ||||
-rw-r--r-- | hid/lib/drivers/usb-keymap.h | 4 | ||||
-rw-r--r-- | keymap.csv | 4 | ||||
-rw-r--r-- | kvmd/keyboard/mappings.py | 8 | ||||
-rw-r--r-- | web/kvm/index.html | 49 | ||||
-rw-r--r-- | web/kvm/window-keyboard.pug | 18 | ||||
-rw-r--r-- | web/share/css/keypad.css | 11 |
7 files changed, 86 insertions, 12 deletions
diff --git a/hid/lib/drivers-avr/ps2/keymap.h b/hid/lib/drivers-avr/ps2/keymap.h index 8f407bb5..7d10953c 100644 --- a/hid/lib/drivers-avr/ps2/keymap.h +++ b/hid/lib/drivers-avr/ps2/keymap.h @@ -144,5 +144,9 @@ void keymapPs2(uint8_t code, Ps2KeyType *ps2_type, uint8_t *ps2_code) { case 105: *ps2_type = PS2_KEY_TYPE_SPEC; *ps2_code = 94; return; // Power case 106: *ps2_type = PS2_KEY_TYPE_REG; *ps2_code = 97; return; // IntlBackslash case 107: *ps2_type = PS2_KEY_TYPE_REG; *ps2_code = 106; return; // IntlYen + case 108: *ps2_type = PS2_KEY_TYPE_REG; *ps2_code = 81; return; // IntlRo + case 109: *ps2_type = PS2_KEY_TYPE_REG; *ps2_code = 19; return; // KanaMode + case 110: *ps2_type = PS2_KEY_TYPE_REG; *ps2_code = 100; return; // Convert + case 111: *ps2_type = PS2_KEY_TYPE_REG; *ps2_code = 103; return; // NonConvert } } diff --git a/hid/lib/drivers/usb-keymap.h b/hid/lib/drivers/usb-keymap.h index a63598cf..8371b04e 100644 --- a/hid/lib/drivers/usb-keymap.h +++ b/hid/lib/drivers/usb-keymap.h @@ -132,6 +132,10 @@ uint8_t keymapUsb(uint8_t code) { case 105: return 102; // Power case 106: return 100; // IntlBackslash case 107: return 137; // IntlYen + case 108: return 135; // IntlRo + case 109: return 136; // KanaMode + case 110: return 138; // Convert + case 111: return 139; // NonConvert default: return 0; } } @@ -106,3 +106,7 @@ NumpadDecimal,104,0x63,reg:0x71,0x53,XK_KP_Decimal Power,105,0x66,spec:0x5e,0xe05e,XK_XF86_Sleep IntlBackslash,106,0x64,reg:0x61,0x56, IntlYen,107,0x89,reg:0x6a,0x7d, +IntlRo,108,0x87,reg:0x51,0x73, +KanaMode,109,0x88,reg:0x13,0x70, +Convert,110,0x8a,reg:0x64,0x79, +NonConvert,111,0x8b,reg:0x67,0x7b, diff --git a/kvmd/keyboard/mappings.py b/kvmd/keyboard/mappings.py index e639cef4..af7b1ad1 100644 --- a/kvmd/keyboard/mappings.py +++ b/kvmd/keyboard/mappings.py @@ -149,6 +149,10 @@ KEYMAP: dict[str, Key] = { "Power": Key(mcu=McuKey(code=105), usb=UsbKey(code=102, is_modifier=False)), "IntlBackslash": Key(mcu=McuKey(code=106), usb=UsbKey(code=100, is_modifier=False)), "IntlYen": Key(mcu=McuKey(code=107), usb=UsbKey(code=137, is_modifier=False)), + "IntlRo": Key(mcu=McuKey(code=108), usb=UsbKey(code=135, is_modifier=False)), + "KanaMode": Key(mcu=McuKey(code=109), usb=UsbKey(code=136, is_modifier=False)), + "Convert": Key(mcu=McuKey(code=110), usb=UsbKey(code=138, is_modifier=False)), + "NonConvert": Key(mcu=McuKey(code=111), usb=UsbKey(code=139, is_modifier=False)), } @@ -435,6 +439,10 @@ AT1_TO_WEB = { 86: "IntlBackslash", 87: "F11", 88: "F12", + 112: "KanaMode", + 115: "IntlRo", + 121: "Convert", + 123: "NonConvert", 125: "IntlYen", 57372: "NumpadEnter", 57373: "ControlRight", diff --git a/web/kvm/index.html b/web/kvm/index.html index afc51b42..9ddf5e77 100644 --- a/web/kvm/index.html +++ b/web/kvm/index.html @@ -1293,14 +1293,12 @@ <div class="label"> </div> </div> <div class="spacer-fixed"></div> - <div class="key small" data-code="IntlYen"> - <div class="label">Yen - </div> + <div class="empty small"> + <div class="label"> </div> </div> <div class="spacer-fixed"></div> - <div class="key small" data-code="IntlBackslash"> - <div class="label">N/US - </div> + <div class="empty small"> + <div class="label"> </div> </div> <div class="spacer-fixed"></div> <div class="key small" data-code="Power"> @@ -1412,6 +1410,45 @@ </div> </div> </div> + <div class="keypad-block"> + <div class="keypad-row"> + <div class="key small" data-code="IntlBackslash"> + <div class="label">\<br>| + </div> + </div> + </div> + <hr> + <div class="keypad-row"> + <div class="key small" data-code="IntlYen"> + <div class="label">¥<br>_ + </div> + </div> + </div> + <div class="keypad-row"> + <div class="key small" data-code="IntlRo"> + <div class="label">\<br>ろ + </div> + </div> + </div> + <div class="keypad-row"> + <div class="modifier small" data-code="KanaMode"> + <div class="label"><b>•</b><br>Kana + </div> + </div> + </div> + <div class="keypad-row"> + <div class="modifier small" data-code="NonConvert"> + <div class="label"><b>•</b><br>N/Cnv + </div> + </div> + </div> + <div class="keypad-row"> + <div class="modifier small" data-code="Convert"> + <div class="label"><b>•</b><br>Cnv + </div> + </div> + </div> + </div> </div> <div class="keypad" id="keyboard-mobile" align="center"> <div class="keypad-block"> diff --git a/web/kvm/window-keyboard.pug b/web/kvm/window-keyboard.pug index 21b2379a..fdd00b15 100644 --- a/web/kvm/window-keyboard.pug +++ b/web/kvm/window-keyboard.pug @@ -112,8 +112,8 @@ div(id="keyboard-window" class="window") div(class="keypad-block") div(class="keypad-row") +empty(2, "small") - +key(2, "IntlYen", "small") Yen - +key(2, "IntlBackslash", "small") N/US + +empty(2, "small") + +empty(2, "small") +key(0, "Power", "small") PWR hr div(class="keypad-row") @@ -143,6 +143,20 @@ div(id="keyboard-window" class="window") +empty(2, "") +key(2, "NumpadDecimal", "small") .#[br]Del +key(0, "NumpadEnter", "small") Ent + div(class="keypad-block") + div(class="keypad-row") + +key(0, "IntlBackslash", "small") \#[br]| + hr + div(class="keypad-row") + +key(0, "IntlYen", "small") ¥#[br]_ + div(class="keypad-row") + +key(0, "IntlRo", "small") \#[br]ろ + div(class="keypad-row") + +modifier(0, "KanaMode", "small") Kana + div(class="keypad-row") + +modifier(0, "NonConvert", "small") N/Cnv + div(class="keypad-row") + +modifier(0, "Convert", "small") Cnv div(id="keyboard-mobile" class="keypad" align="center") div(class="keypad-block") diff --git a/web/share/css/keypad.css b/web/share/css/keypad.css index f3f16834..5c6e4668 100644 --- a/web/share/css/keypad.css +++ b/web/share/css/keypad.css @@ -54,22 +54,25 @@ div.keypad div.keypad-row div.spacer-fixed { div.keypad div.key, div.keypad div.modifier, div.keypad div.empty { + vertical-align: top; + font-size: 0.9em; + text-align: center; box-sizing: border-box; padding: 0; width: 40px; + height: 40px; +} +div.keypad div.empty { + border: thin solid transparent; } div.keypad div.key, div.keypad div.modifier { - font-size: 0.9em; - text-align: center; - vertical-align: top; box-shadow: var(--shadow-micro); border: var(--border-key-thin); border-radius: 6px; color: var(--cs-key-default-fg); background-color: var(--cs-key-default-bg); cursor: pointer; - height: 40px; } div.keypad div.key:hover, div.keypad div.modifier:hover { |