Repository navigation
ps2: Japanese (JIS) keyboard support - #187
Merged
Merged
Conversation
With the PROM set to the Japanese layout, `]` typed `\`, `}` typed `|` and `_` typed nothing. IRIX and the PROM read the keyboard in scancode set 3. There, an SGI keyboard sends 0x5C for the ANSI `\|` key and 0x53 for the key left of Enter on ISO/JIS boards (JIS `]}`). The host reports both as KeyCode::Backslash, so iris always sent 0x5C, which the JP table reads as the yen key. IntlRo, IntlYen, NonConvert, Convert and KanaMode had no mapping in any set. - keyboard = "ansi" | "iso" | "jis" in the config (--keyboard on the command line) gives the host keyboard's physical shape. iso/jis send 0x53 for Backslash in set 3. ansi (the default) is unchanged. - The JIS keys map in sets 1, 2 and 3. Set-3 codes are from xkeyboard-config sgi_vndr/indy(jp106) (X keycode = set-3 code + 8): ro 0x51, yen 0x5C, muhenkan/henkan/kana 0x85/0x86/0x87. - iris-gui: a Keyboard selector on the Display tab sets it; release (bundled) builds can't import iris.toml, so this is the only way there. - iris-gui: egui has no Key for the JIS-only keys, so they arrive with only a logical key. A physical-less `\` or `|` is sent as IntlYen. Yen works, ro types `\` (never `_`), and the conversion keys stay dead in the GUI. Tested with a real JIS keyboard and the PROM on the Japanese layout, at the PROM command monitor: - standalone iris window (--keyboard jis): `]`, `}` and `_` now type correctly. - iris-gui (Display > Keyboard: JIS): `]` and `}` type correctly, yen and ro type `\`, and Shift+ro and the conversion keys do nothing, as expected. A new unit test (jis_keys_set3) checks the set-3 codes, and the ps2 and config tests pass. The workspace builds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
techomancer
reviewed
Oct 8, 2026
| KeyCode::BracketRight => Some(ScancodeSet3::RBracket), | ||
| // Sets 1 and 2 give the ANSI `\|` key and the ISO/JIS key left of | ||
| // Enter one code; set 3 does not, and the host can't tell them apart. | ||
| KeyCode::Backslash if self.layout.load(Ordering::Relaxed) != KeyboardLayout::Ansi as u8 => |
Owner
There was a problem hiding this comment.
hmm not sure if we should touch iso here, but we from the layouts i see most national euro keyboars have # there. so lets see if we get complaints ;-)
Owner
|
@vic485 thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With the PROM set to the Japanese layout,
]typed\,}typed|and_typed nothing.IRIX and the PROM read the keyboard in scancode set 3. There, an SGI keyboard sends 0x5C for the ANSI
\|key and 0x53 for the key left of Enter on ISO/JIS boards (JIS]}). The host reports both as KeyCode::Backslash, so iris always sent 0x5C, which the JP table reads as the yen key. IntlRo, IntlYen, NonConvert, Convert and KanaMode had no mapping in any set.\or|is sent as IntlYen. Yen works, ro types\(never_), and the conversion keys stay dead in the GUI.Tested with a real JIS keyboard and the PROM on the Japanese layout, at the PROM command monitor:
],}and_now type correctly.]and}type correctly, yen and ro type\, and Shift+ro and the conversion keys do nothing, as expected. A new unit test (jis_keys_set3) checks the set-3 codes, and the ps2 and config tests pass. The workspace builds.Partially fixes #185, fully fixing the gui would require egui-winit patches.