RSS Feed

Tags

Archives

Categories

Recent Posts

Links


Howto adjust mouse button mapping under Redhat 6 or Scientific linux, or other distro using HAL daemon

May 16th, 2011 by D in howto, Linux, Mouse, Redhat, Scientific linux, X

So how to set button mapping with Linux distribution using Hal daemon, that is as far as I know, Redhat 6, Scientific linux 6, and probably other distro based on RHEL, then you have Ubuntus that seems to have also used that thing so setup the mouse.

The trick is with HAL daemon, if you look at the good old /etc/X11/xorg.conf you may probably see that there is no mouse line or in the case of Ubuntu there is no /etc/X11/xorg.conf.

This is our little new friend HAL that is pushing hardware configuration to your X or window manager.

So to change the button mapping of your mouse, you will have to mess around with HAL.

In my case I like to switch button 2 for button 3 and 3 for 2.

For our personal knowledge you can use hal-device to look at the hardware information provided by HAL, you will find the mouse entry in there.

So lets create a new thing for our mouse

* Switch to root user (sudo, or any other means you are used to)
* Edit (or create one) the file /etc/hal/fdi/policy/99-local.fdi
* Then set this content in that file :

<?xml version=”1.0″ encoding=”UTF-8″?>
<deviceinfo version=”0.2″>
<device>
<match key=”info.capabilities” contains=”input.mouse”>
<merge key=”input.x11_driver” type=”string”>evdev</merge>
<merge key=”input.x11_options.ZAxisMapping” type=”string”>4 5</merge>
<merge key=”input.x11_options.ButtonMapping” type=”string”>1 3 2</merge>
</match>
</device>
</deviceinfo>

* Save the file, switch to runlevel 3, restart HAL daemon then switch to runlevel 5, or just restart for “normal” people.
telinit 3
/etc/init.d/haldaemon restart
telinit 5

* Now look at hal-device output you should see that the ButtonMapping is on every mouse found on the system.

Comments are closed.