If you have ever tried using a Japanese JIS layout keyboard on an English-set computer, you will soon realise that the unique keys that come with a split spacebar, right shift and backspace layout do not function without setting the computer to a Japanese locale. The keys still send scancodes, so thankfully, you can make use of them with a little extra work.
PC keyboard layouts are handled software or converter side rather than keyboard-side, which means that despite your OS natively discarding functionality from the JIS keys, the keyboard still sends scancodes from the JIS-unique keys. This means there's something we can target with third-party/non-default solutions. The solutions I've written involve using AutoHotkey (for both PS/2 and USB keyboards on Windows), Soarer's Converter (for PS/2 keyboards on any platform using this specific converter) and xmodmap (for both PS/2 and USB keyboards on Linux using Xorg).
Below is a diagram of the target key functionality I'll be implementing as my example, but you do not have to follow this if you want to get creative. As some rationale though: since I'm British, the key I'm missing by using a JIS keyboard is
\, so I've remapped that onto one of the keys. Beyond this, I unified the split backspace area into two single-unit backspaces, added another backspace to the left of the small spacebar (emulating an Erase-Eaze configuration), extended the spacebar with the key immediately right to it, and added a convenient delete key to the right of the new spacebar key.
For context, the two keyboards I will be working on is an IBM Preferred USB Keyboard SK-8806 (P/N 24P0459) and IBM Preferred Pro PS/2 Keyboard KB-0225 (P/N 32P5118).
For Windows users, the most established solution is AutoHotkey. I set up a keyboard hook with AutoHotkey to figure out what scancodes were coming from the JIS-unique keys, but I've made a diagram of the scancodes so you don't have to do it yourself.
For a list of possible keys you can use for your remap, see AutoHotkey's List of Keys. However, I've added the ones I used below as a snippet.
To use the AutoHotkey code provided, you'll need to create an AutoHotkey script to put it in. Once AutoHotkey is installed, right-click an empty area of your Windows desktop, hover over "New", and then click "AutoHotkey Script" to create the file, then open the file in your favourite text editor and paste the code above in and save. Once done, simply double-click the script file to run the code. If you then wish to make this script run every time Windows starts up, simply compile the script via right-clicking the script file and clicking "Compile Script", and then follow steps 3 and 4 from these instructions from Microsoft on how to make an app run on startup.
For those already using a Soarer's Converter solution for your PS/2 keyboard, you might as well use its built-in hardware-side remapping capability. For observing scancodes with Soarer's Converter, most use PJRC's HID Listen program. Once again, I've made a diagram of the scancodes though.
For a list of possible keys you can use for your remap or macros, open the
codes.html page in the "docs" folder that would have been bundled with the same zip file that contained the flashing tools for Soarer's Converter. Below is my solution:
To use the Soarer's Converter code provided, you'll need to create a
.sc to put it in. To do so, simply create an empty file with your favourite text editor, paste the code above in, and then save it with the
.sc extension at the end of the file's name. See my Soarer's 101 tutorial for instructions on downloading and using the needed flashing tools.
For Linux users using the Xorg display server, the
xmodmap command can be used to remap keys. To figure out scancodes, you can run
xev, but once again, I've made a diagram of the scancodes I observed already.
For a list of possible keys you can use for your remap, you can use the
xmodmap -pk command to get an exhaustive list. The values you're looking for will be in the first bracketed string per row. Below is my solution, which resides in a shell script to make execution easier.
To use the example provided, you'll need to copy and paste the snippet into your favourite text editor and save the file with a
.sh extension. After which, you'll need to make the file executable by running
chmod +x your_remap.sh. You can then run the file like
./your_remap.sh. To make this shell script run at startup, here are three possible things you can try.