User:XT-8147/Userboxes/Windows

ugh
I use a Kensington 4 button trackball due to wrist problems, and they don't want to release their MouseWorks software for Windows 7. I loathe Logitech's trackball layouts, so either I have to keep using Windows XP forever, or move my gaming to Linux, where I can easily set up my trackball without specific software from Kensington.

It really is easy. Here's a shitty wiki table I can reference. The buttons indicate the default mapping, viewable in Linux by running xev in console and clicking them. The text is how I have it mapped on Windows.

required packages (names valid on ubuntu): xautomation, xbindkeys, and of course you'll need X, which if you have a graphical interface, you do.

Being that I can't find xautomation anywhere else (and by 'anywhere else' I mean ArchLinux), try installing whatever package on your distribution it is that includes xte, as that's what we need.

Use xmodmap to reorder the buttons.

Button 1 = left click

Button 2 = middle click

Button 3 = right click

Button 4 = vertical scroll

Button 5 = vertical scroll

Button 6 = horizontal scroll

Button 7 = horizontal scroll

Button 8 = extra button 1

Button 9 = extra button 2

etc.

In my setup, to swap buttons 3 and 8 so right click will be where I want it to be, I just ran this:

xmodmap -e "pointer = 1 2 8 4 5 6 7 3 9"

Next, to actually turn that extra button into a double click button, xbindkeys and xautomation are required.

In console, type nano ~/.xbindkeysrc (even if the file doesn't exist) to open up your xbindkeys config. Add the following two lines:

"/usr/bin/xte 'mouseclick 1' 'mouseclick 1'" b:8 + Release

Save and exit. Run xbindkeys -n and try to double click something to see if it works. It should. Press Ctrl+C in the console and then run xbindkeys by itself to apply the config.

You'll probably have to modify your system so that xbindkeys starts up when X does, that's outside the scope of this.