archieroques
Posts: 26
Joined: Sun Mar 16, 2014 8:13 pm

Completely change the keymapping of a keyboard in Raspbian

Sat Aug 22, 2015 1:14 pm

Hi,

Apologies if this isn't the right forum, I couldn't find one for keyboards specifically.

I am building a portable RPi in a (large) mint tin. I bought a wireless keyboard in Maplin ages ago (they no longer sell it, it was product code N99KA). I ripped it open, and the PCB fits absolutely perfecrly inside the tin. I really want to use it, because it's such a great fit.

However, I have a problem. The keyboard was originally in game-controller style casing. Consequently, they placed the trackpad at the top, so you could reach it easily when holding it. I would like the trackpad at the bottom; having it at the top is strange. All the arrow keys are at the top too, but I want them at the bottom.

The ribbon cable to the trackpad is too short to reposition it below the keyboard, and even if it wasn't, there's no space at the bottom since it's such a tight fit. What I want to do, is flip the PCB upside down, so that the stuff I want at the bottom is at the bottom, and the keyboard is at the top. However, this would leave me with an upside-down qwerty keyboard. Which isn't much fun.

I could reposition the keys physically, but I would then need to completely change the keymapping of every key. Can I do this without reprogramming the surface-mount microchip on the keyboard PCB? I'm planning to use Raspbian, but could use other OSes if it would help to just do this bit. There's a bit on the Debian wiki here about changing keymapping : https://wiki.debian.org/Keyboard , but I'm unsure if that refers to completely changing the keymapping, or just switching between common layouts such as QWERTY/QWERTZ.

Thanks,
Archie

User avatar
kusti8
Posts: 3439
Joined: Sat Dec 21, 2013 5:29 pm
Location: USA

Re: Completely change the keymapping of a keyboard in Raspbi

Sat Aug 22, 2015 1:21 pm

I found this with a quick Google and it looks like it could work. (It says it works for console, but it should also work for X)

http://www.shallowsky.com/linux/keymap.html
There are 10 types of people: those who understand binary and those who don't.

archieroques
Posts: 26
Joined: Sun Mar 16, 2014 8:13 pm

Re: Completely change the keymapping of a keyboard in Raspbi

Sat Aug 22, 2015 1:42 pm

That looks pretty good. I will give it a go soon, I think I'll draw out what I propose each key to be, try and find the identifier of each key and then make my own keymap.

User avatar
jojopi
Posts: 3268
Joined: Tue Oct 11, 2011 8:38 pm

Re: Completely change the keymapping of a keyboard in Raspbi

Sat Aug 22, 2015 1:46 pm

I do not understand what you are proposing to do. If the keyboard is upside down, there will be the wrong number of keys on each row. There is no way to remap the spacebar as all the digits 4…9.

Also, most keyboard matrices do not have full n-key rollover, but support pressing up to two typing keys and three modifiers at a time. If you try to remap the Shift, Ctrl, Alt functions onto other keys, they are likely to ghost at the hardware level.

archieroques
Posts: 26
Joined: Sun Mar 16, 2014 8:13 pm

Re: Completely change the keymapping of a keyboard in Raspbi

Sat Aug 22, 2015 2:55 pm

There are already the wrong number of keys on each row - it's not very well designed. I have redesigned the keyboard, so that it does fit, in my opinion, better than it did before and it's upside down.

The space key thing was an issue - I've decided that I want that row to be the function keys, so I will just have fewer function buttons (as the space bar uses 3 buttons which all have the same key code).

As for the problem with the modifier keys, I'll just have to try it and see. It's not the end of the world if the modifier keys are at the top of the keyboard anyways.

Return to “General discussion”