ccMSC/ckb — pull request #2 by bmerrison (2014-11-09 00:09:46+00:00)
Title: Add ability to use UK key layout (compile-time option for now).

UK keyboards have an additonal key (# / ~) and the backslash / vertical bar key is in a different position. Neither the LEDs nor the keys themselves were working properly, prior to this patch. I've added a new key map to the daemon's keyboard.c that matches my UK K70. It's a little odd, but it seems Linux (Ubuntu 14.04 at least) interprets KEY_102ND as "\" and KEY_BACKSLASH as "#" when you have your keyboard layout set as UK. I've also updated the ckb utility to add the # key and to change the position of the backslash key.

To enable these changes you need to compile with the KEYMAP_UK symbol defined. If it's not defined, the code is exactly as before. I've updated the makefile to define a symbol called KEYMAP_DEFAULT - this isn't actually used for anything, but will indicate to users what they need to change if they want to switch to using the UK layout.

I realise that selecting a keyboard layout probably isn't something that should be done as a compile-time setting, but I didn't want to make any major changes to your code. Also, I'm impatient ;)