This howto describes how to map any special keys on your device to normal keys. This howto was written specifically for mapping the Samsung Q1 Ultra arrow keys to behave as arrows, instead of the function keys that they are mapped to by default in Ubuntu Mobile. When a key is pressed, the kernel reads the key scan code from the keyboard controller. This is mapped by the kernel keyboard driver to a key code, which is what programs (such as X11) receive from the kernel. You can use the 'showkey' utility from the console to see the key codes for the various buttons/keys, or if the key is not mapped you can look in dmesg for errors reporting an unmapped key, the errors are generated every time an unmapped key is pressed/released. If your device already has a key mapped, you can look at the fdi files in /usr/share/hal/fdi/information/10freedesktop/ to see the key scan code, if you know what it is being mapped to. Once you know what keys you want to map, and what they are being mapped to, you need to create a .fdi to configure the mapping. The proper place for a custom fdi file is in /etc/hal/fdi/policy and should be named something like '99-Samsung-Q1U-Keys.fdi'. The fdi files are XML, and can control many aspects of X configuration, key mappings, etc. More information about this file format is available in the [[http://people.freedesktop.org/~david/hal-spec/hal-spec.html|hal spec]]. We are only concerned with the key mapping portion of the file, an example for the Q1U is below: {{{ e054:f4 e058:up e059:right e056:down e057:left e064:f5 e06e:f11 input.keymap }}} The important parts of the file are the two matches to make sure the keys are only applied to the correct machine, and then the key mappings themselves. To find the values for 'system.hardware.vendor' and 'system.hardware.product', you can use the 'lshal' utility. For example, to find the product you would do this: {{{ ume@q1u:~$ lshal | grep system.hardware.product system.hardware.product = 'SQ1US' (string) }}} The key mapping are done with the key scan code first, followed by what key code they are being mapped. The scan code is a hex value, while the key code is a human readable string for the key (f5, up, etc). Once the fdi file is created it will be used on the next restart of the device.