You can configure it using xinput.
This is always what I've done. it works a peach for every trackman I've ever used. It's the last, simplest step from the official ubuntu page.
#!/bin/bash xinput set-button-map "Logitech USB Trackball" 1 2 3 4 5 6 7 8 9 xinput set-int-prop "Logitech USB Trackball" "Evdev Wheel Emulation Button" 8 8 xinput set-int-prop "Logitech USB Trackball" "Evdev Wheel Emulation" 8 1 xinput set-int-prop "Logitech USB Trackball" "Evdev Wheel Emulation Axes" 8 6 7 4 5 xinput set-int-prop "Logitech USB Trackball" "Evdev Wheel Emulation X Axis" 8 6 xinput set-int-prop "Logitech USB Trackball" "Evdev Drag Lock Buttons" 8 9` chmod +x ~/trackman.sh
then, whenever you login (or in a startup script),
Done. This tiny little scripts works much, much better than the official ~60mb windows installer IMHO :)
i've got that configuration and it worked very well until i upgraded to Debian Stretch.... and what's happens ? 'evdev' is not used anymore; because 'libinput' replaced it.
Check the lib used :
xinput list-props "Logitech USB Trackball"
If you find many props starts with 'Evdev', forget my comment, ELSE if it starts with 'libinput', this line could do the thing :
xinput set-prop "Logitech USB Trackball" "libinput Button Scrolling Button" 8
Too, i recommend THIS for confort :
# Enable middle button (on 9) and disable all useless and conflicting buttons and others. xmodmap -quiet -e "pointer = 1 0 3 4 5 6 7 0 2 0 0 0"
( And NOT THIS :
xmodmap -quiet -e "pointer = 1 0 3 4 5 6 7 8 2 10 11 12" which only says to use middle button (2) instead of Browser Next (9). You need to say to use only scrolling - then nothing - when you click on Browser Prev (8) )
RECAP So, with these modifications, you've got a ball and 4 usable buttons (1-BIG 2-small 3-small 4-BIG) on the trackball.
- A ball -> mouse move + mouse scroll if you press button 2.
- Button 1 -> classic left button
- Button 2 -> Press it to scroll with the ball
- Button 3 -> middle button (usefull to copy selection in linux)
- Button 4 -> classic right button
The way you're doing this isn't quite correct. .bashrc is executed when you start bash shell. Unless you're only using it from within a terminal emulator running within an X session, it will give you errors each time you log in or open a new terminal.
You may want to look at the solution I provided here
I tested this in 11.10 and it works very nicely. This selection is from "Ubuntuwiki"
Avoid using Hal for this release because it has known issues. Put the following into terminal, using gedit:
$HOME/bin/trackball.sh using this command:
Then paste this into the file:
#!/bin/bash dev="Logitech USB Trackball" we="Evdev Wheel Emulation" xinput set-int-prop "$dev" "$we Button" 8 8 xinput set-int-prop "$dev" "$we" 8 1 # xinput set-int-prop "$dev" "$we" 8 1 # xinput set-int-prop "$dev" "$we Button" 8 9 # xinput set-int-prop "$dev" "$we X Axis" 8 6 7 # xinput set-int-prop "$dev" "$we Y Axis" 8 4 5 # xinput set-int-prop "$dev" "Drag Lock Buttons" 8 8
Make sure trackball.sh begins with
Make the script executable by running this:
chmod +x $HOME/bin/trackball.sh`
Add the following lines to
and put this in the file even if it is empty:
xmodmap $HOME/.Xmodmap > /dev/null 2>&1 $HOME/bin/trackball.sh
Edit $HOME/.Xmodmap using:
pointer = 1 8 3 4 5 6 7 9
Log out and back in and viola!
If your mouse is connected with a PS/2 -> USB adapter, you could try out the command
For me it showed, among other things, that there is a
Bus 001 Device 018: ID 04d9:1400 Holtek Semiconductor, Inc. PS/2 keyboard + mouse controller
The first part of the USB identity code (04d9) identifies the manufacturer, and the second the product.
Now you can use that information to discover the identities of devices connected to that adapter by typing
xinput list --long | grep 04d9
What I got was
↳ HID 04d9:1400 id=9 [slave pointer (2)]
↳ HID 04d9:1400 id=8 [slave keyboard (3)]
I have no keyboard attached to the adapter, but there is my old trackball mouse, Logitech TrackMan Marble FX.
So I wanted to know more about the device identified above as id=9, and I used xinput command to get what I wanted:
xinput list-props 9
The first line of the listing was
Device 'HID 04d9:1400':
The listing also shows the properties of the device, and I used those to build commands needed for modifying those properties. What I ended with was two commands:
xinput set-int-prop "pointer:HID 04d9:1400" "Evdev Wheel Emulation Button" 8 3 xinput set-int-prop "pointer:HID 04d9:1400" "Evdev Wheel Emulation" 8 1
The first line turns Button 3 of the TrackMan mouse into a Wheel emulation button. (Button 4 a.k.a. "8" does not seem to work at all). "Pointer" in the commands refers to the mouse and prevents confusing things with "keyboard" that could be attached to the same adapter (not in my system).