Talk:HOWTO Advanced Mouse

From Gentoo Linux Wiki

Jump to: navigation, search

Might mention /dev/input/mice instead of /dev/mouse since 2005.0. -- reisio

Feel free to revise, add new mice that work or don't work, or include new ideas. Thanks! -- meowsqueak

Contents

[edit] Can't use xvkbd ?

If for some reason you can't/don't want to use xvkbd(Why the heck' do I need a graphical keyboard emulator just for sending key-events?!) there's another utility: xte. It's in the xautomation ebuild. Now you can replace in your .xbindkeysrc e.g.

"xvkbd -text "[\A\[Left]]""

by

"/usr/bin/xte 'keydown Alt_L' 'key Left' 'keyup Alt_L' &"

homepage:

http://hoopajoo.net/projects/xautomation.html

There's no documentation except xte -h

[edit] evdev issues

"If your kernel does not support evdev, you cannot use xev to monitor xevents. You can either get a kernel that does, or try configuring your mouse with out it." wtf? Whole howto use old mouse interface and in end of howto there is tips to use evdev kernel module in order to get events from xev. People to use evdev driver with x.org...? imo evdev-module is useless without evdev-input-driver usage with x.org.

That is a very good point as it isn't mentioned in the HOWTO! xorg-x11 needs to be compiled with INPUT_DEVICES="evdev" in order to make evdev work! --Al 11:54, 15 August 2006 (UTC)

Al, That isn't necessarily correct. Compiling xorg with INPUT_DEVICES="evdev" will automatically pull in the evdev input driver, but this howto just mentions how to manually pull it in with portage. Same difference, really. --JBDubbs 1:35, 15 August 2006 (EST)

If you say so. :-) I am far from being a Gentoo expert. --Al 13:29, 16 August 2006 (UTC)

[edit] XOrg7, evdev, and MX1000

Is that section right? I have a MX510, and after upgrading to XOrg7 I had to change my old

File: File Title
        Driver      "mouse"
        Option      "Protocol" "evdev"
        Option      "Dev Name" "PS2++ Logitech MX Mouse"
        Option      "Dev Phys" "isa0060/serio1/input0" # cat /proc/bus/input/devices
        Option      "Device" "/dev/input/MX510" # cat /proc/bus/input/devices

to

File: File Title
        Driver      "evdev"
        Option      "Device" "/dev/input/MX510"

--elmicha 01:48, 17 April 2006 (UTC)

[edit] Big Changes

Sorry, but this wiki article was a bit of a mess after being contributed to way too many times. Completely redid the formatting, added correct information about evdev for both xorg 6.8 and 6.9/7.0, moved around comments about specific mice, and divided the sections between PS/2 and USB mice depending on your xorg version. I also took out a lot about the old XFree86 server. Let me know what you think.

--JBDubbs

[edit] Which one is correct?

"To have X load your mapping each time it's started, simply place it inside the /etc/X11/xinit/.Xmodmap file. " or "To apply the setting for all users, place the same line in /etc/X11/Xmodmap."

Fixed that.... JBDubbs

[edit] Specifying EVDEV device by only name

Whoever wrote the comment on specifying the EVDEV device by NAME, it would be appreciated if you would write a section on it rather than posting a comment saying how a part of this article is wrong :) Thanks

I for my part couldn't make the X-server start by simply using the Name option with my MX510 which is connected via PS/2! In the log, X-server complained about not having been given a Device. After adding Option "Device" "/dev/input/event1" everything went smoothly. :-)

-- Al (not having commented on this issue before ;-)

[edit] No more need for xmodmap?

From the discussion on the forum here: http://forums.gentoo.org/viewtopic.php?t=455793

There is no need to use xmodmap to modify what buttons point where as 
there seems to be a new option for that within xorg.conf, "ButtonMapping"

I have a Logitech Trackball Marble FX which has 4 buttons and no scroll wheel. The following configuration makes the scroll wheel emulation work without using xmodmap:

Section "InputDevice"
      Identifier  "Mouse1"
      Driver      "mouse"
      Option      "Device" "/dev/input/mice"
      Option      "Protocol" "auto"
      Option    "EmulateWheel" "True"
      Option    "EmulateWheelButton" "6"
      Option    "YAxisMapping" "4 5"
      Option    "XAxisMapping" "6 7"
      Option    "ButtonMapping" "1 2 3 6 7"
EndSection

"EmulateWheelButton" "4" doesn't work and can't find any decent documentation. I'm glad the above configuration does work though. -Henk


I've found that it works when it feels like it.... It works for my secondary G5 but not my primary MX1000. No idea why. --Jbdubbs 22:28, 17 November 2006 (UTC)

[edit] My dream Marble FX setup (Jason King)

[edit] xorg.conf

This started out as a correction of the above (to set Buttons to "4" - the default is "3") but I'm going to post my Marble FX dream setup.

For starters I swap the left and right buttons because my thumb just seems like more of a "context menu" finger, and also I like to use my thumb on the ball while holding the primary mouse button.

I also wanted the little red button to do two things. First I wanted it to be the scroll wheel button, but also - I want it to emulate a double-click. Sounds impossible? Just you wait. Anyway, here's my InputDevice section:

Section "InputDevice"
  Identifier  "Logitech Trackman MarbleFX"
  Driver  "mouse"

  Option "Protocol"            "ExplorerPS/2"
  Option "Device"              "/dev/input/mice"
  Option "Buttons"             "4"
  Option "ButtonMapping"       "3 2 1 8"
  Option "EmulateWheel"        "true"
  Option "EmulateWheelButton"  "8"
  Option "EmulateWheelInertia" "8"
  Option "YAxisMapping"        "4 5"
  Option "EmulateWheelTimeout" "200"
EndSection

A few things to note, the little red button is button 8! It works like this, the three normal buttons are 1, 2 and 3 (left, middle right), then 4 and 5 are vertical scroll virtual buttons, 6 and 7 are horizontal scroll virtual buttons, and then any other buttons a pointing device has start at 8 and go up. The "ExplorerPS/2" has the provision for up to 10 buttons. So anyway, the little red button is button 8.

However, the "Buttons" setting only has to have how many actual buttons you have. Defaults to "3" so we set it to "4".

So, then we have the wheel emulation settings, we want button 8 (the little red button) to be the wheel emulation button, and we only specify the YAxisMapping because plenty of apps have weird defaults for the horizontal scrolls (like Firefox switches between tabs - which just makes my head explode).

The EmulateWheelInertia is just about how fast the scroll works. And then that last setting is where it gets interesting.

"EmulateWheelTimeout" means that if I hold that button down for less than 200 milliseconds then instead of doing the wheel emulation (by sending button 4 or 5 events), it sends a button 8 event. We'll get to that in a sec, for now that's all the xorg.conf settings, save, restart, etc.. Your MarbleFX will now do wheel scroll with the red button.

[edit] xbindkeys

Now for the double-click. You need two packages, one to bind the keys and one to simulate the clicks:

 emerge xbindkeys xautomation

Then:

 $ cat - > ~/.xbindkeysrc
 "/usr/bin/xte 'mouseclick 1' 'mouseclick 1' &"
 b:8 + Release
 ^D
 $ xbindkeys

What this says is to bind the execution of "xte click click" (ie. doubleclick) to the event of a button 8 release. Ie. we just made the button 8 release event into a double-click.

And our xorg.conf setting said that as long as we release that little red button within 200 milliseconds, it will generate a button 8 event for us.

Just add xbindkeys to your session or .xinitrc file or wherever, and you're done. Happy clicking.

[edit] Emerging Evdev Directly

Wouldn't it be the more proper, gentoo way of doing things, to emerge evdev by adding it to /etc/make.conf list of INPUT_DEVICES= ? The person following the guide could then be instructed to emerge -uDavN world and it would be installed as a dependency of xorg-x11 instead. It just feels cleaner and seems to be the more proper course. I just want to see if others feel the same instead of making the big edit. --GenKreton

[edit] Compile as Module

On my computer, something resets the "psmouse_max_proto" variable in the kernel's "psmouse-base.c" code from PSMOUSE_AUTO (i.e., 11) to PSMOUSE_PS2 (i.e., 1) if the code is compiled into the kernal rather than compiled as a module. The result is that the code assumes that the attached mouse is a "bare" three button mouse and that other button functions, e.g., scrolling, do not exist. I have not determined where (or why) the reset occurs. Both a touchpad "easy cat" mouse and a conventional 5 button/wheel mouse were affected. I added a line to the wiki because others may have the same problem. Ivar 11:08, 1 June 2007 (UTC)

[edit] So what do I do if I have just installed xorg 7.2 on a fresh machine????

What do I do on a fresh install? -- How-to says nothing about this, but only talks about archaic updates.

[edit] Is there anyone using the MX620?

Question: Xorg seems to ignore any configuration. The tilt wheel doesn't generate events. It always autodetects the mouse but there aren't all buttons available. Is it possible that the Synaptics sections influences the other sections?

Answer: To get the mouse to work, you have to use Xorg's evdev module, and you need a persistent name for the receiver's event device.

  • Create a udev rule:
KERNEL=="event[0-9]*", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c521", SYSFS{../phys}=="*input0" NAME="input/%k", SYMLINK="input/event-mx620"
  • Reload udev
  • Edit your xorg.conf:
Section "InputDevice"
    Identifier      "Logitech MX620"
    Driver          "evdev"
    Option          "CorePointer"
    Option          "Device" "/dev/input/event-mx620"
    Option          "RelHWHEELMapTo" "Buttons 7 6"
EndSection
  • Restart X and enjoy!
Warning: If you unplug the receiver, the mouse will not work again until you restart X.

For me, I didn't have to bother with the udev rule. Setting it up with evdev for /dev/input/mice worked fine. However, it seems that sometimes the horizontal scroll buttons flip

Anybody try to get the search button to do anything? It's a really weird event in xev - not a button.

[edit] Kernel-Config up-to-date?

"USB Human Interface Device (full HID) support" is found at "Device Drivers ---> HID Devices" in my kernel and CONFIG_USB_HIDINPUT doesn't exist (amd64, gentoo 2.6.22). Can someone crosscheck this with his configuration? --80.137.68.198 08:53, 5 October 2007 (UTC)

[edit] A4Tech X-750BF

Here is my config for this mouse

File: xorg.conf
Section "InputDevice"
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Buttons" "7"
    Option         "Device" "/dev/input/mice"
    Option         "Name" "A4 Tech USB Laser Mouse"
    Option         "Protocol" "explorerps/2"
    Option         "Vendor" "Sysp"
    Option         "ZAxisMapping" "6 7"
EndSection
 
xmodmap -e "pointer = 1 2 3 8 9 4 5 6 7"

[edit] Update for Current XOrg 6/2008

I'll go ahead and update this page as time permits. It really isn't all that off, just some of the less common configurations either changed or don't work anymore. For the majority of users it should be fine. --Jbdubbs 14:49, 13 June 2008 (UTC)

Personal tools