Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
X.org: two mice + xmodmap. How to?
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
Aysen
Apprentice
Apprentice


Joined: 18 May 2005
Posts: 187
Location: Poland

PostPosted: Fri Apr 07, 2006 7:25 pm    Post subject: X.org: two mice + xmodmap. How to? Reply with quote

Hi everyone!

I have just discovered that I still own a nice wireless mouse with a ball (supposed to work like two scrollwheels) that I completely forgot about and decided to try it out. The mouse works perfectly except one thing. My primary mouse is Logitech MX900 and it's set as the core pointer. Its thumb buttons generate codes 8 and 9, so I use xmodmap to make them 6 and 7 to work as back and forward. Now the weird thing - the new mouse's (MT1007) thumb buttons also generate codes 8 and 9 (checked with xmodmap pointer = default), but xmodmap doesn't change them. Without xmodmap it's like this (left column = generated code numbers, right column = buttons that generate them):
MX900:
Code:
1 = left and "window" button
2 = middle (click the wheel)
3 = right
4 = wheel up and the button above the wheel
5 = wheel down and the button below the wheel
6 = (not generated)
7 = (not generated)
8 = thumb back and the button above the wheel
9 = thumb forward

MT1007:
Code:
1 = left
2 = middle (click the ball)
3 = right
4 = wheel up
5 = wheel down
6 = wheel left
7 = wheel right
8 = thumb back
9 = thumb forward

So, if I use xmodmap like this:
Code:
xmodmap -e "pointer = 1 2 3 4 5 8 9 6 7 10 11 12 13 14"
then MX900's thumb buttons generate codes 6 and 7. This, however, doesn't change MT1007's behaviour at all. It seems that nothing I do with xmodmap affects the secondary mouse :/
It'd be good to know why it's like that and if there's any way to fix it. Any help appreciated!

This is my xorg.conf:
Code:
Section "InputDevice"
    Identifier  "Logitech MX900"
    Driver      "mouse"
    Option "Protocol"    "ExplorerPS/2"
    Option "Device"      "/dev/input/mouse0"
    Option "Buttons"     "10"
EndSection

Section "InputDevice"
    Identifier  "Mediatech MT1007"
    Driver      "mouse"
    Option "Device"      "/dev/input/mouse1"
    Option "Buttons"     "9"
EndSection

Section "ServerLayout"
    Identifier  "Simple Layout"
    Screen "Screen 1"
    InputDevice "Logitech MX900" "CorePointer"
    InputDevice "Mediatech MT1007" "SendCoreEvents"
    InputDevice "Keyboard1" "CoreKeyboard"
EndSection


Also, from the button map for the MX900, you might have noticed that it doesn't really work like it should - the "window" button generates "1" code (should be a seperate code, maybe 10 or something) and the button above the wheel generates two codes - the one for the wheel up event (which is correct) and the one for backward event (which makes that button ususable). Is there anyone with a MX900 who was able to set it up correctly?

Thanks in advance! :)

PS. I've already googled for things like "xorg two mice" and such, but didn't find anything related... But please don't beat me if I just missed something ;)
Back to top
View user's profile Send private message
placeholder
Advocate
Advocate


Joined: 07 Feb 2004
Posts: 2500

PostPosted: Fri Apr 07, 2006 7:56 pm    Post subject: Reply with quote

Perhaps you should try out evdev. Emerge it(not sure what it is called in Gentoo so run a search), and then set them up like so:

Code:
Section "InputDevice"
  Identifier   "Logitech MX1000" # Change as necessary
  Driver   "evdev"
  Option   "Device"   "/dev/input/mx1000" # Will be /dev/input/event<n> for you since I have a symlink rule done via udev
EndSection


Evdev handles vertical/horizontal scrolling automatically so it might allow this to work. If you are not sure which event each mouse is, do `cat /dev/input/event#` and move the mice around to see which one corresponds to each event device. Cheers. ^_^
Back to top
View user's profile Send private message
Aysen
Apprentice
Apprentice


Joined: 18 May 2005
Posts: 187
Location: Poland

PostPosted: Sat Apr 08, 2006 2:35 am    Post subject: Reply with quote

Thank you very much emma, with evdev my MX900 works perfectly (each button has its own code) :)

However, my main problem is still unsolved. What's more, I've discovered a few other issues.
  1. Using evdev as the MX900 driver (like this:
    Code:
    Section "InputDevice"
        Identifier  "Logitech MX900"
        Driver      "evdev"
        Option "Device" "/dev/input/event2"
    EndSection
    ) breaks my keyboard's multimedia keys. They no longer generate any events in xev. I'll investigate this later (OK, I've found a few other threads about it... looks like it's unsolved yet).
  2. evdev doesn't recognize MT1007's ball properly. The horizontal and vertical directions generate the same codes (4 and 5). The "mouse" driver recognizes them properly.
  3. There seems to be a nasty bug in X.org - when both mice were using evdev, I unplugged one of the receivers and restarted X. It failed miserably and totally froze - no ALT-CTRL-BS, no ALT-CTRL-Fn, no nothing. The last thing in the log was:
    Code:
    (**) Option "CorePointer"
    (**) Logitech MX900: Core Pointer
    (**) Logitech MX900: Device: "/dev/input/event2"
    (II) Logitech MX900: Found x and y relative axes
    (II) Logitech MX900: Found mouse buttons
    (II) Logitech MX900: Found keys
    (II) Logitech MX900: Configuring as mouse
    (II) Logitech MX900: Configuring as keyboard
    (**) Option "SendCoreEvents"
    (**) Mediatech MT1007: always reports core events
    (**) Mediatech MT1007: Device: "/dev/input/event3"
    (EE) Unable to open evdev device "/dev/input/event3".
    (EE) PreInit failed for input device "Mediatech MT1007"
    (II) UnloadModule: "evdev"

       *** If unresolved symbols were reported above, they might not
       *** be the reason for the server aborting.

    Backtrace:
    0: /usr/bin/X(xf86SigHandler+0x9e) [0x80baa3e]

    Fatal server error:
    Caught signal 11.  Server aborting
    Looks like it unloaded the evdev driver when it found out that the second mouse was not present, not caring that the first mouse was actually using the driver (those 2 EEs are not critical - when MX900 was using the evdev and MT1007 the mouse driver, those EEs were also present, but the evdev driver wasn't unloaded and X was running fine). I guess I'll file a bug (if my interpretation of the error is correct).
  4. xmodmap definitely works only for the core pointer - when I made MT1007 the core pointer, its thumb buttons got mapped as 6 and 7 and MX900's stayed as 8 and 9, but when MX900 was core then it was exactly the opposite. Does anyone know a way to suprass this limitation?

Hardware details if anyone's interested:
  • The mouse (MX900) and keyboard (Cordless Elite (uh, what a name... model number Y-RP20, anyway)) are from the Logitech Cordless Desktop MX for Bluetooth.
  • The Mediatech MT1007 mouse identifies itself as Acrox RF Ball Mouse in sysfs. Media-Tech's details.

I'll be thankful if someone helps me with the xmodmap problem.
In the meantime, I'll look into the multimedia keys problem.

Regards!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum