Skip to content

Add Japanese keyboard (JIS) layout#103

Merged
elvissteinjr merged 4 commits intoelvissteinjr:masterfrom
jf9tgl:master
Dec 17, 2025
Merged

Add Japanese keyboard (JIS) layout#103
elvissteinjr merged 4 commits intoelvissteinjr:masterfrom
jf9tgl:master

Conversation

@jf9tgl
Copy link
Contributor

@jf9tgl jf9tgl commented Dec 14, 2025

Hello!
I've added a new keyboard layout for Japanese users.
This layout includes a kanji key, which enables smoother switching between Romaji input and alphabet input.
The mechanism involves sending VK_KANJI to toggle the IME state.
This keyboard layout adheres to the JIS standard.
image

@elvissteinjr
Copy link
Owner

Hi! Thank you for your contribution.
A Japanese keyboard layout is something I was hoping to have in the application eventually, but it's not really one I could confidentially tackle myself, so this is very nice.

IME handling should work for desktop input. Not sure if it's working correctly for the VR UI input fields or browser overlays. Need to check still but that would be an issue for me to handle.

As for the layout itself, I can't comment on the Japanese part of it so I'll just assume it's right and working on Japanese systems.
There a few little things that stand out to me, however.

The Enter key looks like it should be in an ISO-Enter shape. Desktop+ does allow for that key shape even if it's a bit unintuitive. Basically have two keys of the type "Virtual Key (ISO-Enter)", with the first one in the upper row spanning the full width and the second one on the row below it will automatically stretch above it.
Label goes onto the second key and they'll act as one in the app later.
Most of the keyboard layouts present aside the US and Korean one have an ISO-Enter key, so you could look at them for reference.

This is more minor and subjective to a degree, but on the numpad the Page Up/Down key labels are in all caps "PG UP/DN" while the ones in the navigation cluster are camel case "PgUp/Dn". I'm not really seeing a reason not to have these labels be the same for consistency.
It's probably also nicer if the numpad 5 key label was aligned with the other labels around it. An extra empty line would do it.

Everything else looks fine to me.
Thanks again!

- Use ISOEnter key shape for Enter
- Unify PgUp/PgDn labels
- Adjust numpad 5 label alignment
Copy link
Contributor Author

@jf9tgl jf9tgl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your review!
I've adjusted the layout.
Also, I was able to input Japanese correctly using Google Japanese Input and Microsoft IME on my system.

@elvissteinjr
Copy link
Owner

There's one more thing actually. I should've seen it the first time, sorry about that.
The ¥-key has the "" set a string input. Is this intentional? That would make it the same as the backslash key further down.

Otherwise it looks good to me.
I did some rudimentary check of the IME keys as well... okay, what a proper result looks like is beyond my knowledge, but it made characters appear on the desktop.
On VR UI and Browser overlays not so much, but that could also be the lack of a correct IME setup on my end. CEF also seems to have some IME specific handlers but not sure where to start there to be honest (invoking Windows IME for offscreen content seems like a not intended use-case?)...

For now I'd say desktop input works and that's the most important thing. And again, it's not the fault of the keyboard layout anyways.

@jf9tgl
Copy link
Contributor Author

jf9tgl commented Dec 16, 2025

The ¥-key has the "" set a string input. Is this intentional?

Yes, it is intentional, assuming "" represents a backslash.
However, I have corrected the ¥ key as its actual output is VK_OEM_5 (220). This was similarly resolved for the Korean keyboard layout. The final output is either a backslash or a yen symbol. Both share the same character code U+005C.


Additionally, the hiragana key appears to output VK_OEM_ATTN (240) to enter full-width (Romaji input) mode rather than IME_KANA (21), so I've corrected that.

@elvissteinjr elvissteinjr merged commit 3ca60b3 into elvissteinjr:master Dec 17, 2025
@elvissteinjr
Copy link
Owner

I went ahead and merged since it looked good to me. But let me know if you have any other changes you want merged.
Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants