Change mouse keys

Dear all, I am having a mouse with two rear buttons (back and forward)
I would like to inverse those two. I am using latest opensuse with the kde environment.

I used the program xev and these two seem to produce valid key codes
(please find the output that both create below)

ButtonPress event, serial 35, synthetic NO, window 0x5e00001,
    root 0x156, subw 0x5e00002, time 439270559, (43,42), root:(1041,65),
    state 0x10, button 9, same_screen YES

EnterNotify event, serial 35, synthetic NO, window 0x5e00001,
    root 0x156, subw 0x0, time 439270559, (43,42), root:(1041,65),
    mode NotifyGrab, detail NotifyInferior, same_screen YES,
    focus YES, state 16

KeymapNotify event, serial 35, synthetic NO, window 0x0,
    keys:  86  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   

ButtonRelease event, serial 35, synthetic NO, window 0x5e00001,
    root 0x156, subw 0x5e00002, time 439272189, (43,42), root:(1041,65),
    state 0x10, button 9, same_screen YES

LeaveNotify event, serial 35, synthetic NO, window 0x5e00001,
    root 0x156, subw 0x0, time 439272189, (43,42), root:(1041,65),
    mode NotifyUngrab, detail NotifyInferior, same_screen YES,
    focus YES, state 16

ButtonPress event, serial 35, synthetic NO, window 0x5e00001,
    root 0x156, subw 0x5e00002, time 439273009, (43,42), root:(1041,65),
    state 0x10, button 8, same_screen YES

EnterNotify event, serial 35, synthetic NO, window 0x5e00001,
    root 0x156, subw 0x0, time 439273009, (43,42), root:(1041,65),
    mode NotifyGrab, detail NotifyInferior, same_screen YES,
    focus YES, state 16

KeymapNotify event, serial 35, synthetic NO, window 0x0,
    keys:  86  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   

ButtonRelease event, serial 35, synthetic NO, window 0x5e00001,
    root 0x156, subw 0x5e00002, time 439274229, (43,42), root:(1041,65),
    state 0x10, button 8, same_screen YES

LeaveNotify event, serial 35, synthetic NO, window 0x5e00001,
    root 0x156, subw 0x0, time 439274229, (43,42), root:(1041,65),
    mode NotifyUngrab, detail NotifyInferior, same_screen YES,
    focus YES, state 16

Could you please explain me how I should read the output they produce and how I can invert these two?

I would like to thank you in advance for your help

B.R
Alex

On 01/31/2012 03:26 PM, alaios wrote:
> Could you please explain me how I should read the output they produce
> and how I can invert these two?

what operating system and version are you using?
what desktop environment and version are you using?
have you ever been asked these questions before?
if you are tired of being asked imagine how tired i am of asking…

so, open a terminal, copy/paste this into it


cat /etc/X11/xorg.conf.d/11-mouse.conf

then, copy and paste the input and output back into this thread
following the instructions here: http://goo.gl/i3wnr


DD http://tinyurl.com/DD-Caveat
Read what Distro Watch writes: http://tinyurl.com/SUSEonDW

I am sorry for that… I will try to put my information regarding os (latest linux with the included kde) into my signature

Section "InputClass"
        # 046d:c50e
        # 046d:c501
        Identifier      "Logitech Trackball"
        MatchVendor     "Logitech, Inc."
        MatchProduct    "MX-1000 Cordless Mouse Receiver|Cordless Mouse Receiver"
        MatchIsPointer  "on"
        Driver  "evdev"
        Option  "Buttons"       "8"
        Option  "EmulateWheel"  "on"
        Option  "EmulateWheelButton"    "8"
        Option  "YAxisMapping"  "4 5"
        Option  "XAxisMapping"  "6 7"
EndSection

Section "InputClass"
        # 046d:c521
        Identifier      "Logitech Multibutton Mouse"
        MatchVendor     "Logitech, Inc."
        MatchProduct    "MX620 Laser Cordless Mouse"
        MatchIsPointer  "on"
        Driver  "evdev"
        Option  "HWHEELRelativeAxisButtons"     "7 6"
EndSection

Section "InputClass"
        # 046d:c050
        Identifier      "Logitech Easy Optical Mouse"
        MatchVendor     "Logitech, Inc."
        MatchProduct    "RX 250 Optical Mouse"
        MatchIsPointer  "on"
        Driver  "evdev"
        Option  "Buttons"       "7"
        Option  "YAxisMapping"  "4 5"
        Option  "XAxisMapping"  "6 7"
EndSection

Section "InputClass"
        # 045e:0095
        Identifier      "Microsoft IntelliMouse Explorer"
        MatchVendor     "Microsoft Corp."
        MatchProduct    "IntelliMouse Explorer 4.0 (IntelliPoint)"
        MatchIsPointer  "on"
        Driver  "evdev"
        Option  "HWHEELRelativeAxisButtons"     "7 6"
EndSection

Section "InputClass"
        # 0210:0003
        Identifier      "0210:0003"
        MatchVendor     "0210"
        MatchProduct    "0003"
        MatchIsPointer  "on"
        Driver  "evdev"
        Option  "EmulateWheel"  "on"
        Option  "EmulateWheelButton"    "2"
EndSection

Section "InputClass"
        # 0002:000a
        Identifier      "0002:000a"
        MatchVendor     "0002"
        MatchProduct    "000a"
        MatchIsPointer  "on"
        Driver  "evdev"
        Option  "EmulateWheel"  "on"
        Option  "EmulateWheelButton"    "2"
EndSection

Section "InputClass"
        # 04b3:300f
        Identifier      "IBM 300f"
        MatchVendor     "IBM Corp."
        MatchProduct    "300f"
        MatchIsPointer  "on"
        Driver  "evdev"
        Option  "EmulateWheel"  "on"
        Option  "EmulateWheelButton"    "2"
EndSection

Section "InputClass"
        # Novell Bug #597214
        Identifier      "IBM TPPS/2 TrackPoint"
        MatchProduct    "TPPS/2 IBM TrackPoint"
        MatchIsPointer  "on"
        Driver  "evdev"
        Option  "EmulateWheel"  "on"
        Option  "EmulateWheelButton"    "2"
        Option  "YAxisMapping"    "4 5"
        Option  "XAxisMapping"    "6 7"
        Option  "Emulate3Buttons"    "on"
        Option  "EmulateWheelTimeout"    "200"
EndSection

Section "InputClass"
        # Novell Bug #668842
        Identifier      "PS/2 Generic Mouse"
        MatchProduct    "PS/2 Generic Mouse"
        MatchIsPointer  "on"
        Driver  "evdev"
        Option  "EmulateWheel"  "on"
        Option  "EmulateWheelButton"    "2"
        Option  "YAxisMapping"    "4 5"
        Option  "XAxisMapping"    "6 7"
        Option  "Emulate3Buttons"    "on"
        Option  "EmulateWheelTimeout"    "200"
EndSection

Section "InputClass"
        # Novell Bug #671776
        Identifier      "ImPS/2 Generic Wheel Mouse"
        MatchProduct    "ImPS/2 Generic Wheel Mouse"
        MatchIsPointer  "on"
        Driver  "evdev"
        Option  "EmulateWheel"  "on"
        Option  "EmulateWheelButton"    "2"
        Option  "YAxisMapping"    "4 5"
        Option  "XAxisMapping"    "6 7"
        Option  "Emulate3Buttons"    "on"
        Option  "EmulateWheelTimeout"    "200"
EndSection

Section "InputClass"
        # 03f0:1126
        Identifier      "HP 1126"
        MatchVendor     "Hewlett-Packard"
        MatchProduct    "1126"
        MatchIsPointer  "on"
        Driver  "evdev"
        Option  "MinX"  "0"
        Option  "MaxX"  "3000"
        Option  "MinY"  "0"
        Option  "MaxY"  "3000"
EndSection

So, that would be openSUSE 12.1 and KDE. What’s more important, is which brand and model the mouse is.
This http://fvue.nl/wiki/Configuring_my_5-button_mouse_in_X_Windows contains info on switching mousebuttons. It may need some experimenting, but should give a lead to what you want to achieve. The structure of the Xorg configuration has changed, but the options to use are still the same

Thanks all for the support

first I tried with finding out how muy current mouse is recognized

cat /proc/bus/input/devices
I: Bus=0003 Vendor=1a7c Product=0068 Version=0110
N: Name="Kingsis Peripherals  Evoluent VerticalMouse 3 "
P: Phys=usb-0000:00:1a.7-3.2/input0
S: Sysfs=/devices/pci0000:00/0000:00:1a.7/usb1/1-3/1-3.2/1-3.2:1.0/input/input2
U: Uniq=
H: Handlers=mouse0 event2 
B: PROP=0
B: EV=17
B: KEY=1f0000 0 0 0 0
B: REL=103
B: MSC=10

which is correctly identified as I have the Kingsis Peripherals Evoluent Vertical Mouse 3.

Then I have to edit the config files for the xorg.conf
in my opensuse there are the following files

ls /etc/X11/xorg.conf.d/
10-evdev.conf  50-device.conf  50-monitor.conf  50-synaptics.conf  50-wacom.conf
11-mouse.conf  50-fpit.conf    50-screen.conf   50-vmmouse.conf    90-keytable.conf

I guess that I have to edit 11-mouse.conf (in some tutorials I found the xorg.conf file was edited directly).
Then I checked what is inside that file 11-mouse.conf and I found that there is no entry regarding my Evoluent Mouse…

The first question is how all my 5 mouse keys work when my model is not listed there? Then I have to figure out how I can swap the functionality of the two mouse keys I have (make back doing forward and forward doing the back functionality).

I hope this time I wrote much more information.

B.R
Alex

On 02/02/2012 09:36 AM, alaios wrote:
> I hope this time I wrote much more information.

yes you did good…

the tutorials you found which tell to edit xorg.conf are old and/or
directed at distros other than openSUSE–i say that because openSUSE has
not had an xorg.conf since (about) 11.1, or so…

so yes, you will want to edit 11-mouse.conf

FIRST, when editing config files always first make a backup of the
file as it was before you change anything…

i normally do that at a command line, but you can do it with a root
powered ‘file manager’ if you wish…do NOT log into KDE/Gnome etc to
have a root file manager…

i would open a terminal and type

su -
cd /etc/X11/xorg.conf.d/
ls /etc/X11/xorg.conf.d/
cp /etc/X11/xorg.conf.d/11-mouse.conf 11-mouse.conf.BAK

which would result in a copy of the original with the added .BAK, a fact
you can check with

ls /etc/X11/xorg.conf.d/

then, if in editing you come to a point you wish you had the OLD file
back it is a simple thing to

cp /etc/X11/xorg.conf.d/11-mouse.conf.BAK 11-mouse.conf.BAK01
cp /etc/X11/xorg.conf.d/11-mouse.conf.BAK 11-mouse.conf

which will also make a copy of the version which didn’t work (so you can
look at it and scratch your head)…subsequent versions that don’t would
could be also numbered .BAK02, .BAK03 and etc…that way an ls will
show all versions from original (.BAK) to whatever, in order…

now, i have looked at your 11-mouse.conf file and do not know the best
way to go–however, you should not become too concerned about your
mouse’s trademark name not matching the words in the conf
file…because it is very possible that your “Kingsis Peripherals
Evoluent” is made by Logitech, Inc. (or with Logitech ‘guts’) for sale
under the Kingsis brand…and, it is therefore why your mouse works as
expected (because Linux sees the insides, and not the brand on the
retail box)…

someone else will have to help you edit to switch the button
function–AFTER you have the conf backed up…


DD
Read what Distro Watch writes: http://tinyurl.com/SUSEonDW

> you will want to edit 11-mouse.conf

If you are editing text files, then rather than mess with xorg config I
would suggest editing xmodmaprc as I originally suggested in the other
thread. I had hoped somebody might know of a desktop-based GUI for this.

On 02/02/2012 12:42 PM, Dave Howorth wrote:
> If you are editing text files, then rather than mess with xorg config I
> would suggest editing xmodmaprc as I originally suggested in the other
> thread. I had hoped somebody might know of a desktop-based GUI for this.

hmmmmm…i don’t have a xmodmaprc…

and, i don’t know the location of “the other thread” so if you have help
for how this poster can create(?) and set up that file to achieve the
action swap for two buttons, please do so here…or maybe point to the
other thread, if the info is there…


DD
Read what Distro Watch writes: http://tinyurl.com/SUSEonDW

DenverD wrote:
> On 02/02/2012 12:42 PM, Dave Howorth wrote:
>> If you are editing text files, then rather than mess with xorg config I
>> would suggest editing xmodmaprc as I originally suggested in the other
>> thread. I had hoped somebody might know of a desktop-based GUI for this.
>
> hmmmmm…i don’t have a xmodmaprc…
>
> and, i don’t know the location of “the other thread” so if you have help
> for how this poster can create(?) and set up that file to achieve the
> action swap for two buttons, please do so here…or maybe point to the
> other thread, if the info is there…

man xmodmap

I did it with
xmodmap -e “pointer = 1 2 3 4 5 6 7 9 8”
Warning: Only changing the first 9 of 13 buttons.

the two buttons I wanted to change were 8 and 9. I found that through xev. Any idea how I can save these at startup ?
Now time to also improve my keyboard :slight_smile:

On 02/17/2012 12:36 PM, alaios wrote:
> Any idea how I can save these at startup ?

note: you do not need to be root to do any of this:

try using kwrite (or any text file editor) to create a small bash script
in a new file with this inside:


#!/bin/sh
# created 17 Feb 2012 by alaios
# reverses the actions of buttons 8 and 9
xmodmap -e "pointer = 1 2 3 4 5 6 7 9 8"

and save it to /home/[yourID]/.kde/Autostart/[choose_fileName]

like, maybe you wanna name it shiftButtons

then, to make the file executable, do this in a user terminal


chmod +x /home/[yourID]/.kde/Autostart/shiftButtons

just make sure to use the correct file name and user name…

WELL, i do not know, maybe the modmap command must be executed as root,
if it does then the above won’t work…and, it will have to be fired
off a different way…holler


DD http://tinyurl.com/DD-Caveat http://tinyurl.com/SUSEonDW

Thanks a lot… I think it would be better to apply this for all users. What is the place to write this script then?

Regards
Alex

alaios wrote:
> Thanks a lot… I think it would be better to apply this for all users.
> What is the place to write this script then?

Except that that script doesn’t work for all users. It only works for
KDE users.

And it’s not the designed way to set xmodmap defaults. That’s what
xmodmaprc is for. Please RTFM everybody. When using X11-based displays,
it pays to have an understanding of the basics.

On 02/21/2012 12:14 PM, Dave Howorth wrote:
> Please RTFM everybody. When using X11-based displays,
> it pays to have an understanding of the basics.

i admit i have no understanding of the basics and therefore when i
looked at that man my eyes glaze over…

since you have more than basic understanding of X11-based displays why
not help the OP, rather than repeatedly pointing to the (useless to a
noob) man?


DD
What does DistroWatch write about YOU?: http://tinyurl.com/SUSEonDW