Reference

XGetDeviceButtonMapping(3) on Linux

The text c31f4609224b, as Debian 6.0 (Squeeze) shipped it.

query or change device button mappings

XGetDeviceButtonMapping(3) on Linux now