====== X Keymapping ======
On occasions I found that after ''emerge -uDN @world'' that my keymappings under X had gone awry and reverted to US, despite no changes to my ''/etc/X11/xorg.conf''. Thing were fine under a TTY, but not under X.
** UPDATE ** This page is now pretty much redundant, HAL has been purged from the Gentoo Portage tree and udev is used (although as of writing it has been [[http://www.reddit.com/r/linux/comments/139tyy/udev_has_been_forked_by_gentoo/|forked]]).
===== Why? =====
These problems arise as a consequence of switching between [[http://www.freedesktop.org/wiki/Software/hal|HAL]] and [[http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html|udev]] for hardware detection. I first encountered the problem when I upgraded to a version of [[wp>Xorg|Xorg]] ''>1.5'' as input devices such as keyboard, mouse and touchpads are now controled by [[http://www.freedesktop.org/wiki/Software/hal|HAL]] and [[http://xorg.freedesktop.org/evdev]]. However, HAL is now effectively dead (unmaintained, no updates) and as such is marked for removal from Gentoo, so now control is now under [[http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html|udev]]/[[http://xorg.freedesktop.org/evdev]]
===== Fixing keyboard maps under HAL =====
As control is now under ''sys-apps/hal'' ([[http://www.freedesktop.org/Software/hal|HAL]]) via [[http://xorg.freedesktop.org/evdev]] the configurations now reside in ''/usr/share/hal/fdi/policy/*''. You //could// edit these but you would have to be careful when updating packages and ensure you do not wipe them out. The alternative is to use a local directory structure and place the changes under ''/etc/hal/fdi/policy/*''.
For the keyboard map you want to have the following file ''/etc/hal/fdi/policy/10-x11-input.fdi'' reflect your heyboards key map.
evdev
hal-setup-keymap
evdev
evdev
gb
compose:menu
==== Synaptics TouchPad ====
If you happen to have a Synaptics Touch Pad (common on many laptops) you will need the file ''/etc/hal/fdi/policy/11-x11-synaptics.fdi''
synaptics
on
1
2
3
1
1
2
3
===== Fixing keyboard maps under udev =====
This is the most likely situation you will be in (after all what is the point in installing and configuring dead packages?). Under udev and evdev devices are semi-automatically detected, but a ''/etc/X11/xorg.conf'' file is required. Within this file you need to define an ''InputClass'' for your keyboard and under this you specify the ''XkbLayout'' as shown
Section "InputClass"
Identifier "Keyboard0"
MatchIsKeyboard "True"
Driver "evdev"
Option "XkbModel" "evdev"
Option "XkbLayout" "gb"
EndSection
==== Synaptics TouchPad ====
If you happen to have a Synaptics Touch Pad (common on many laptops) you will need an ''InputClass'' for this too...
Section "InputClass"
Identifier "Synaptics"
MatchIsTouchpad "on"
MatchDevicePath "/dev/input/event*"
Driver "synaptics"
EndSection
{{tag>gentoo linux howto X}}