You are not logged in.

#1 2010-08-14 16:13:04

esuhl
Member
From: UK
Registered: 2009-09-16
Posts: 140

[SOLVED] Configuring mouse buttons (enabling "scoll mode" on a PS/2...

Can anyone help me to understand how to configure mouse buttons in X?

The "mouse" I have is actually a trackball with extra buttons that toggle a "scroll mode" where the ball controls scrolling instead of pointer position.

I added this to xorg.conf as I understand that input devices in xorg.conf are ignored when device hotplugging is enabled:

Section "ServerFlags"
  Option "AutoAddDevices" "on"
  Option "AutoEnableDevices" "on"
  Option "AllowEmptyInput" "on"
EndSection

I then copied the file 10-x11-input.fdi from /usr/share/hal/fdi/policy/10osvendor/, put it in /etc/hal/fdi/policy/, and added the lines below to the "input.mouse" section that uses the evdev driver:

     <merge key="input.x11_options.Protocol" type="string">ExplorerPS/2</merge>
     <merge key="input.x11_options.ButtonMapping" type="string">1 9 3 4 5 6 7 8 2</merge>
     <merge key="input.x11_options.EmulateWheel" type="string">true</merge>
     <merge key="input.x11_options.EmulateWheelButton" type="string">8</merge>
     <merge key="input.x11_options.EmulateWheelTimeout" type="string">300</merge>
     <merge key="input.x11_options.YAxisMapping" type="string">4 5</merge>
     <merge key="input.x11_options.XAxisMapping" type="string">6 7</merge>
     <merge key="input.x11_options.ZAxisMapping" type="string">4 5</merge>

I tried restarting HAL with /etc/rc.d/hal restart, but this failed, so I rebooted the PC instead.

Unfortunately, though, the extra buttons still don't seem to do anything.

I tried running xev to get the mouse button numbers, which are:
1 = Left button
3 = Right button
9 = Scroll buttons (both of them)

I just can't work out what I'm doing wrong...  Can anyone offer any tips or point me in the right direction?

Last edited by esuhl (2010-08-27 00:25:32)

Offline

#2 2010-08-15 12:48:06

esuhl
Member
From: UK
Registered: 2009-09-16
Posts: 140

Re: [SOLVED] Configuring mouse buttons (enabling "scoll mode" on a PS/2...

Okay - I realise now that just using xorg.conf won't work.  I've just updated the post above with my latest attempt to get the scroll button working... but still no joy :-(

Offline

#3 2010-08-15 13:38:49

Nichollan
Member
From: Stavanger, Norway
Registered: 2010-05-18
Posts: 110

Re: [SOLVED] Configuring mouse buttons (enabling "scoll mode" on a PS/2...

You should perhaps read this regarding an Xorg update: http://www.archlinux.org/news/502/

This release works with udev for input hotplugging and supports /etc/X11/xorg.conf.d/*.conf as a replacement for the hal .fdi files. After upgrading to this release, configuration for input devices in hal is ignored. Documentation about this change can be found on the Xorg wiki article.

Offline

#4 2010-08-17 16:58:48

esuhl
Member
From: UK
Registered: 2009-09-16
Posts: 140

Re: [SOLVED] Configuring mouse buttons (enabling "scoll mode" on a PS/2...

Aha!  Thank you so much for replying!  I added this to the end of /etc/X11/xorg.conf.d/10-evdev.conf:

Section "InputClass"
    Identifier "Marble Mouse via PS/2"
    MatchIsPointer "on"
    MatchProduct   "ImExPS/2 Generic Explorer Mouse"
    Driver "evdev"
    Option "Protocol"         "ExplorerPS/2"
    Option "ButtonMapping"        "1 9 3 4 5 6 7 8 2"
    Option "EmulateWheel"        "true"
    Option "EmulateWheelButton"    "9"
    Option "EmulateWheelTimeout"    "300"
    Option "YAxisMapping"        "4 5"
    Option "XAxisMapping"        "6 7"
    Option "ZAxisMapping"        "4 5"
EndSection

I still couldn't scroll in Firefox, but discovered that you can change these settings (via about:config):

middlemouse.paste = false
middlemouse.contentLoadURL = false
general.autoScroll = true

And now it works perfectly!

Just one more question...  In other applications, the "scroll buttons" seem to work like a middle mouse button (copying & pasting selected text).  Is there a way to enable the scroll toggling in other applications?

Last edited by esuhl (2010-08-17 16:59:16)

Offline

Board footer

Powered by FluxBB