My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
MakeKbd  
How to make a kbd file
Updated Mar 10, 2010 by scottaki...@gmail.com

Making a .kbd file

To facilitate the creation of a kbd (keyboard) file I've written the utility make_kbd.py which can be found in the src/keytrain directory.

When you run the program and hit keys on the keyboard it retrieves the scancocde and the key value that the system returns for that key.

Example output:

$ ./make_kbd.py 
30 a
48 b
46 c
32 d
18 e
33 f
Goodbye
Written to out.kbd

If you were to look at out.kbd you would see that only six keys have been defined, and that the uppercase parts are missing (has a ?). You would also note that trying to use that kbd file would fail because more than one key has '?' assigned to it.

...
# Scancode Map-Name Lower-Case Upper-Case Finger Row 
18 KEY_E e ? 3 1
30 KEY_A a ? 1 0
32 KEY_D d ? 3 0
33 KEY_F f ? 4 0
46 KEY_C c ? 3 -1
48 KEY_B b ? 4 -1

You can re-run make_kbd.py with an existing file to continue updating it.

$ ./make_kbd.py out.kbd 
42 
30 A
48 B
46 C
32 D
18 E
33 F
Goodbye
Written to out.kbd

Now you can see that more of out.kbd has been defined.

...
# Scancode Map-Name Lower-Case Upper-Case Finger Row 
18 KEY_E e E 3 1
30 KEY_A a A 1 0
32 KEY_D d D 3 0
33 KEY_F f F 4 0
42 KEY_SHIFT_L  Shft 1 -1
46 KEY_C c C 3 -1
48 KEY_B b B 4 -1

The program picks up some of the values from us.kbd (like 'Shft') and also the information about what finger is used for the key.

You can iterate in this way comparing out.kbd vs us.kbd filling out any missing keys. You may want to use a text editor to copy and paste some key that are impossible to press.

With make_kbd.py you can quickly create a keyboard layout for your keyboard just by mashing keys. The file should be saved with the id of your keyboard.

Powered by Google Project Hosting