≡ Menu

CH Products DT225 Trackball: Xorg Scrolling on Linux

The CH products DT225 trackball (USB) helped me overcome repetitive strain injury (RSI) of my wrist but there is just one thing it lacks compared to the ubiquitous wheel mouse: a scroll wheel! There’s just a trackball (the same size as a snooker ball) and four buttons—two large ones and two small ones.

On Windows XP, the default functions of the four buttons are as follows:

Bottom Left (Large Button): Normal Click
Bottom Right (Large Button): Right Click
Top Left (Small Button): Auto Scrolling (Press any other button to release auto scrolling)
Top Right (Small Button): Back

I liked this combination of functions. But I was not able to replicate it after my switch to CrunchBang Linux.

By default, the functions of the four buttons on CrunchBang are:

Bottom Left (Large Button): Normal Click
Bottom Right (Large Button): Right Click
Top Left (Small Button): Forward
Top Right (Small Button): Back

I hardly never use the Forward and Back functions, so such a set up is redundant. My aim was to get auto scrolling with the trackball while working on all applicable programmes, e.g., web browsers, LibreOffice Writer, LibreOffice Spreadsheet, Text Editor, Evince. (By the way, Evince has a nifty feature that enables auto scrolling from a drop-down menu on right-click.)

To cut a long story short, I haven’t been able to find a way to get auto scrolling by a push of a button on the DT225 yet.

Nevertheless, I found out how to scroll—vertically and horizontally—by pushing down (continuously) on any one of the buttons. (After some testing, I chose the top-right small button to be my scroll button.) Reading many posts on this topic, I gather that this is a function desired by many people, even more so than auto scrolling.

Below is the quick and dirty way I made my top-right button the scroll button (on continuous pressing). The entire setup gives me:

Bottom Left (Large Button): Normal Click
Bottom Right (Large Button): Right Click
Top Left (Small Button): Back
Top Right (Small Button): Forward on click; Vertical and Horizontal Scrolling by pressing down continuously

The solution below should also work on vanilla Debian and also any other Debian-based distro, e.g. Ubuntu, Mint, LMDE.

In /usr/share/X11/xorg.conf.d/10-evdev.conf, I added the following lines:

#       - - - CH Products DT225 Trackball Settings - - -
#       - - - - - by bootstrap (geekhack.org) - - - - - - 
#
#       To help readers understand the configuration better, a CH Products DT225 
#       trackball has buttons labeled as follows:
#       A (left-large), B (left-small), C (right-large), D (right-small). 
#       Usage: A=normal-click  B=Back C=right-click D=Forward 
#       Press button D (hold button while rolling trackball) to emulate 
#       wheel-scrolling. 
#       The trackball can scroll in two-axes, unlike a typical wheel mouse. 
#       Adjust the settings to constrain the scroll action to vertical-axis-only 
#       if you prefer. 
#
Section "InputClass"
#
Identifier  "Mouse0"
MatchProduct "CH PRODUCTS CH USB TRACKBALL"
MatchIsPointer "on"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
#       Physical button labels:     A B C - - - - D (- = no button)
Option "ButtonMapping"     "1 8 3 4 5 6 7 2"
#       EmulateWheel refers to emulating a mouse wheel using trackball.
Option "EmulateWheel" "true"
Option "EmulateWheelButton" "8"
Option "ZAxisMapping" "4 5"
Option "XAxisMapping" "6 7" # Disable this for vertical-only scrolling.
#       Emulate3Buttons refers to the act of pressing buttons A and C.
#       simultaneously to emulate a middle-click or wheel click - work 
#       in progress.
#       Option "Emulate3Buttons" "true"
#       Option "Emulate3Timeout" "50"
#
EndSection

No other changes were necessary. You don’t need to fiddle with the dip switches at the bottom of the device. Neither do you need to alter or create /etc/X11/xorg.conf. There are other ways to get the same result but I’ve found the above the most elegant.

On the ‘Option “ButtonMapping”‘ line, the numbers mean this:

1 = Normal (Left) Click
2 = Forward
3 = Right Click
4 = Up (I suggest you don’t alter this)
5 = Down (I suggest you don’t alter this)
6 = Left (I suggest you don’t alter this)
7 = Right (I suggest you don’t alter this)
8 = Back

Therefore, if you want the top-left (small) button to be the Forward button and the top-right (small) button to be the Back button, then change the line that starts with ‘Option “ButtonMapping”‘ to:

Option "ButtonMapping"     "1 2 3 4 5 6 7 8"

As the code indicates, I’m still trying to find a way of emulating a middle/wheel click on a 3-button mouse. If you already know how, please share.

{ 0 comments… add one }

    Leave a Comment