Greetings, I have had a hunt around the forums and google, but i can't find a similar request, so my appologies if this is a dupe. An example of some of the guides I have read through is
this one.
Here is what I want to do:
I use Amarok as my media player on Mandriva 2007 (Official) and I want to setup the "extra" mouse button on my
Logitech MX518 to send keystrokes to amarok's global hotkeys. One for next track, one for play/pause, and one to display the info about the song i am currently playing (OSD - On Screen Display).
Here are the relevant areas of xorg.conf - I have been trying to get it to work, so I will leave (but commented out) the other things I have tried.
Code:
Section "ServerFlags"
#DontZap # disable <Crtl><Alt><BS> (server abort)
#DontZoom # disable <Crtl><Alt><KP_+>/<KP_-> (resolution switching)
AllowMouseOpenFail # allows the server to start up even if the mouse does not work
EndSection
#Section "InputDevice"
# Identifier "Mouse1"
# Driver "evdev"
# Option "evBits" "+1-2"
# Option "keyBits" "~272-287"
# Option "relBits" "~0-2 ~6 ~8"
# Option "Pass" "3"
# EndSection
Section "InputDevice"
Identifier "Mouse1"
Driver "mouse"
Option "Protocol" "Auto"
Option "Device" "/dev/mouse"
Option "Emulate3Buttons"
Option "Emulate3Timeout" "50"
Option "EmulateWheel"
Option "EmulateWheelButton" "2"
# Option "Buttons" "6"
# Option "ButtonMapping" "1 2 3 6 7 8"
EndSection
#Section "InputDevice"
# Identifier "Mouse1"
# Driver "evdev"
# Option "Device" "/dev/input/event0" # (cat /proc/bus/input/devices)
# Option "Name" "Logitech MX518"
#EndSection
Section "InputDevice"
Identifier "Mouse2"
Driver "evdev"
Option "product" "0xc01e"
Option "vendor" "0x046d"
EndSection
Section "ServerLayout"
Identifier "layout1"
InputDevice "Keyboard1" "CoreKeyboard"
# InputDevice "Mouse1" "CorePointer"
InputDevice "Mouse1" "SendCoreEvents"
InputDevice "Mouse2" "CorePointer"
# InputDevice "Mouse2" "SendCoreEvents"
Screen "screen1"
EndSection
Mouse1 and Mouse2 were there after I installed.
Ok, so that's that done... Now for the result of
evtest.c
Code:
[root@BrightBawx tmp]# ./evtest /dev/input/event0
Input driver version is 1.0.0
Input device ID: bus 0x3 vendor 0x46d product 0xc01e version 0x2200
Input device name: "Logitech USB-PS/2 Optical Mouse"
Supported events:
Event type 0 (Sync)
Event type 1 (Key)
Event code 272 (LeftBtn)
Event code 273 (RightBtn)
Event code 274 (MiddleBtn)
Event code 275 (SideBtn)
Event code 276 (ExtraBtn)
Event code 277 (ForwardBtn)
Event code 278 (BackBtn)
Event code 279 (TaskBtn)
Event type 2 (Relative)
Event code 0 (X)
Event code 1 (Y)
Event code 8 (Wheel)
Testing ... (interrupt to exit)
In
the picture of the mouse the above event codes link the buttons below (I tested them):
Button "A" = LeftBtn (Event Code 272)
Button "B" = RightBtn (Event Code 273)
Button "C" = MiddleBtn (Event Code 274)
Button "D" = SideBtn (Event Code 275)
Button "E" = ExtraBtn (Event Code 276)
Button "F" = ForwardBtn (Event Code 277)
Buttons "G" are not used (they are mouse hardware for changing the DPI of the mouse on the fly and work fine, they also don't produce an event in evtest)
Ok, now with this setup Button F sends a keystroke of ALT+LEFT, and Amarok can "see" that keystroke. The scroll buttons work in webpages (Button "E" goes foward a page, Button "D" goes back) but this seems to be at a level that Amarok cannot see.
I have got xbindkeys and xmodmap installed (Yay for URPMI !! ) but they do not help. Here are their current configs anyway:
.xbindkeysrc (I can't find where i read this... but i'm sure i didn't just make it up ;-)
Code:
"/usr/X11R6/bin/xvkbd -xsendevent -text "\[Alt_L]\[Left]""
b:6
"/usr/X11R6/bin/xvkbd -xsendevent -text "\[Alt_L]\[Right]""
b:7
"/usr/X11R6/bin/xvkbd -xsendevent -text "\[Alt_L]\[Up]""
b:8
.Xmapmod (as advised
here)
Code:
pointer = 1 2 3 6 7
Any ideas what is amiss?