Reference

XGetDeviceButtonMapping(3) on Linux

The text ab0295cfe5af, as Debian 7 (Wheezy) shipped it.

query or change device button mappings

XGetDeviceButtonMapping(3) on Linux now