Creating a New Keyboard Layout

Good day,
I have an 86 key programmable mechanical keyboard with a layout that is a bit different from anything thought of as “standard”.
Inside the Keymap preferences I’ve seen that there are some “non standard” keyboard layouts there (i.e. kinesis), so I was wondering on how can I do the same for this keyboard.

I’ve already went through the keymap -d command and got the text file. It shows a standard 101 key keyboard layout that has nothing to do with the layout I have. So I’m not sure if this is the way to go (tweaking the text file produced by keymap -d) or I am missing something here.

Any insight appreciated.
Regards,
RR

For “standard” keys, in keymap app, you can drag and drop keys to correct their position.
Then you can use keymap -d command to save your customize keymap.
I don’t know how you can get keycodes for your extras keys but if you get some then you can edit the file produced to add them.

The format is shortly documented here: https://git.haiku-os.org/haiku/tree/src/preferences/keymap/KeyboardLayout.cpp#n190

And the files defining existing layouts are here: https://git.haiku-os.org/haiku/tree/data/system/data/KeyboardLayouts

This is unrelated to the keymap, which only maps the keys to characters and has no knowledge of how the keys themselves are laid out on the keyboard.

Good day,

Thanks @PulkoMandy. I will take a look and see if can figure out how to prepare a new keyboard layout.

Regards,
RR

Good day @PulkoMandy,
I’ve been through those links, and checked the layouts in the preferences. Now the question is, with the layout file done, is there a way to test it locally?

Thanks.
Regards,
RR

Put your file in /boot/system/non-packaged/data/KeyboardLayouts ?

Good day @Starcrasher,

Thanks for the tip. I check that location and there is no KeyboardLayouts folder. You mean I should create the folder there and add the layout?

Regards,
RR

Yes. As it is in system, it will ask confirmation. Use shift key to allow renaming of the new folder.

Ok @Starcrasher. Thanks a lot. Will do the testing and report success!

Regards,
RR

Good day,

Allright. Finally got the KeyboardLayout file ready, and working (using it right now):
NKeymap

Now, how to make it available to everyone?

Regards,
RR

Submit it on review.haiku-os.org ideally. Otherwise just attach it to the forum and we’ll figure out a way to include it, I guess.

By curiosity, do you have a picture of this keyboard? The layout seems really amazing.

Good day,

Well, I will need to learn how to do it first, so it’s going to take some time. The moment I know how to submit that will do.

Here is the pic:
IMG_20200725_161503614
It’s a four layered programmable compact mechanical keyboard; I needed something small and ergo. Number pad is on Layer 2, though I still have to figure out how to force numlock ON on Haiku 64b. Actually, the keyboard layout I made is the default layout, without the rotation of keys and without some nonstandard shapes. Though I plan to make another one changing the middle CTRL into ALT, which makes a lot of sense in Haiku for Alt-C, Alt-V using thumb, and without moving hands from home row.

Regards,
RR

1 Like

It might be me, but those taller buttons look very weird on the layout.

Wow! Surprising but nice one.
Lights are not my cup of tea but, the layout seems quite efficient and it’s certainly pleasant to use.
Put that in a sci-fy movie and none will doubt it has been created for the purpose. :smile:

Good day,

Now that you mention it, on the layout I should make them not that tall, 1.5x instead of 2x, to look more like the keyboard itself. Didn’t realize about it until you mentioned. Thanks :wink:

Well, lights can be turned off, though when changing into layer 2 (num keypad), it makes sense to light it up:
IMG_20200725_184846858
so you have well identified which keys are the ones that match the number keypad. The numlock is important to get the numberpad working here, as for now, they are just the arrow keys as with a normal 104 keyboard where the NumLock key is not pressed, and… of course… there is no NumLock key :joy::joy::joy:

Regards,
RR

Good day @PulkoMandy,

Well, seems that Gerrit is more for real Devs, and it’s going to take some time for me to get a hold on it.
Nonetheless, the keyboard layout is located here:
https://gitlab.com/rrhaiku/x-bows_keyboardlayout/-/tree/master
(just in case any dev has free time to check it out) I’ll try to learn how to use Gerrit though, in order to “push” it. In the meantime, I’ll just get the file from the Gitlab repo from other Haikboxes, and copy it as @Starcrasher pointed out.

Thanks!
Regards,
RR

If you face specific hurdles to using Gerrit, consider opening a new thread for it and we’ll try to help.

Good day @humdinger,

Thanks for the tip. Today I’ll do what has to be done beforehand, RTFM. :rofl:
If I have any issues, then I will proceed as you pointed out. :+1:

Thanks again and regards,
RR

Good day,

Looks like it’s done. Hope I didn’t make a mess, because I’m not that sure that I did what should be done. Nonetheless, it said SUCCESS…

Thanks all for your assistance.
Regards,
RR