Skip to content

Commit 435ddc5

Browse files
Diwamotodeadprogram
authored andcommitted
machine: add international keys
1 parent 1de1f87 commit 435ddc5

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

src/machine/usb/hid/keyboard/keycode.go

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,21 @@ const (
209209
KeyF23 Keycode = 114 | 0xF000
210210
KeyF24 Keycode = 115 | 0xF000
211211

212+
// International keys for Japanese and other language keyboards
213+
KeyInternational1 Keycode = 0x87 | 0xF000 // JIS "\" and "_"
214+
KeyInternational2 Keycode = 0x88 | 0xF000 // JIS Katakana/Hiragana
215+
KeyInternational3 Keycode = 0x89 | 0xF000 // JIS "¥" and "|"
216+
KeyInternational4 Keycode = 0x8A | 0xF000 // JIS Henkan
217+
KeyInternational5 Keycode = 0x8B | 0xF000 // JIS Muhenkan
218+
KeyInternational6 Keycode = 0x8C | 0xF000 // JIS Numpad ","
219+
220+
// Language keys for input method switching
221+
KeyLanguage1 Keycode = 0x90 | 0xF000 // Hangul/English
222+
KeyLanguage2 Keycode = 0x91 | 0xF000 // Hanja
223+
KeyLanguage3 Keycode = 0x92 | 0xF000 // JIS Katakana
224+
KeyLanguage4 Keycode = 0x93 | 0xF000 // JIS Hiragana
225+
KeyLanguage5 Keycode = 0x94 | 0xF000 // JIS Zenkaku/Hankaku
226+
212227
KeyUpArrow Keycode = KeyUp
213228
KeyDownArrow Keycode = KeyDown
214229
KeyLeftArrow Keycode = KeyLeft
@@ -222,6 +237,34 @@ const (
222237
KeyRightShift Keycode = KeyModifierRightShift
223238
KeyRightAlt Keycode = KeyModifierRightAlt
224239
KeyRightGUI Keycode = KeyModifierRightGUI
240+
241+
// QMK compatibility aliases for international keys
242+
KeyInt1 Keycode = KeyInternational1
243+
KeyInt2 Keycode = KeyInternational2
244+
KeyInt3 Keycode = KeyInternational3
245+
KeyInt4 Keycode = KeyInternational4
246+
KeyInt5 Keycode = KeyInternational5
247+
KeyInt6 Keycode = KeyInternational6
248+
249+
// QMK compatibility aliases for language keys
250+
KeyLng1 Keycode = KeyLanguage1
251+
KeyLng2 Keycode = KeyLanguage2
252+
KeyLng3 Keycode = KeyLanguage3
253+
KeyLng4 Keycode = KeyLanguage4
254+
KeyLng5 Keycode = KeyLanguage5
255+
256+
// Common keyboard layout aliases
257+
KeyRo Keycode = KeyInternational1 // Japanese "ろ"
258+
KeyKatakanaHiragana Keycode = KeyInternational2 // Japanese Katakana/Hiragana
259+
KeyYen Keycode = KeyInternational3 // Japanese "¥"
260+
KeyHenkan Keycode = KeyInternational4 // Japanese Henkan
261+
KeyMuhenkan Keycode = KeyInternational5 // Japanese Muhenkan
262+
KeyKpJpComma Keycode = KeyInternational6 // Japanese Numpad ","
263+
KeyHangeul Keycode = KeyLanguage1 // Korean Hangul/English
264+
KeyHanja Keycode = KeyLanguage2 // Korean Hanja
265+
KeyKatakana Keycode = KeyLanguage3 // Japanese Katakana
266+
KeyHiragana Keycode = KeyLanguage4 // Japanese Hiragana
267+
KeyZenkakuHankaku Keycode = KeyLanguage5 // Japanese Zenkaku/Hankaku
225268
)
226269

227270
// Keycodes for layout US English (0x0904)

0 commit comments

Comments
 (0)