Inverting mouse axis using Karabiner
Karabiner seems like an extremely versatile piece of software, but I can't seem to find a way to invert the mouse axis with it. For example: When I move the mouse downwards I want the cursor to go upwards, and when I move the mouse to the right, I want the cursor to go left.(*)
Right now I'm using USB Overdrive for this purpose, but I need Karabiner for other stuff, and it would be nice if I could get away with just one program.
(*) This sounds so strange that I feel I owe you an explanation: I have a trackball mouse which, due to it's form factor forces me to turn it 180 degrees on my desk. By inverting the axis in software, it still moves naturally.
Solution 1:
To flip cursor movement you can use a third party tool: Karabiner. Karabiner isn't compatible with Sierra at the time of writing (January 2017).
- Download, install and open Karabiner
- Open in the menulet Karabiner -> Preferences
- Open the tab Misc & Uninstall
- Hit the button Open private.xml
- Open the file private.xml with an appropriate editor
-
Enter the customized keycode
<?xml version="1.0"?> <root> <item> <name>3rd-Party Pointing Device</name> <item> <name>Reverse Vertical & Horizontal Cursor Movement</name> <identifier>reverse.mouse.movement</identifier> <autogen> __FlipPointingRelative__ Option::FLIPPOINTINGRELATIVE_HORIZONTAL, Option::FLIPPOINTINGRELATIVE_VERTICAL, </autogen> </item> </item> </root>
If you already have other items in private.xml omit the first two and the last line of the above code.
Save the file
- Open in the menulet Karabiner -> Preferences the tab Change Key
- Hit the ReloadXML button
- Enable the remapping. It should be listed at the beginning.
If you have a second pointing device (i.e. an Apple mouse or a trackpad) and want to use it normally, you have to restrict the mod to your trackball mouse by adding a devicevendordef/deviceproductdef somewhere and a device tag after the identifier tag in your private.xml. Example (sorry, only an Apple external keyboard):
<devicevendordef>
<vendorname>Apple</vendorname>
<vendorid>0x05ac</vendorid>
</devicevendordef>
<deviceproductdef>
<productname>ExternalKeyboard</productname>
<productid>0x0256</productid>
</deviceproductdef>
...
<device_only>DeviceVendor::Apple, DeviceProduct::ExternalKeyboard</device_only>
You get the various device IDs by opening Karabiner > Misc. & Uninstall > EventViewer > Devices