XSetPointerMapping(3)
β¨ XSetPointerMapping(3) β¨
okay bestie, welcome to an XLIB FUNCTIONS page β manual name folded in right there, no big header copy-paste energy. this one is all about pointer settings: reading and rewriting the mouse/button mapping. it's giving βC library but make it group chat.β no cap. π±οΈπ
πΈ NAME πΈ
XSetPointerMapping, XGetPointerMapping β manipulate pointer settings. that's the name, that's the vibe, periodt. π
π§ SYNTAX π§
int XSetPointerMapping(Display *display, _Xconst unsigned char map[],
int nmap);
int XGetPointerMapping(Display *display, unsigned char map_return[], int
nmap);
π ARGUMENTS π
displayβ specifies the connection to the X server. your lil link to the server, bestie. πmapβ specifies the mapping list. the actual button-map situation.map_returnβ returns the mapping list. this is where the current map comes back out. π₯nmapβ specifies the number of items in the mapping list. basically the length of the list, cute and numeric. π’
π DESCRIPTION π
okay so XSetPointerMapping sets the mapping of the pointer. if it succeeds, the X server generates a MappingNotify event, and XSetPointerMapping returns MappingSuccess. iconic behavior, honestly. β¨
element map[i] defines the logical button number for the physical button i+1. the length of the list must be the same as XGetPointerMapping would return, or a BadValue error results. so don't just freestyle the length, bestie. π
a zero element disables a button, and elements are not restricted in value by the number of physical buttons. however, no two elements can have the same nonzero value, or a BadValue error results. so zero is the βoffβ switch, but duplicates that are nonzero? absolutely not. π
if any of the buttons to be altered are logically in the down state, XSetPointerMapping returns MappingBusy, and the mapping is not changed. translation: the mouse is like βgirl, not right now,β and nothing gets remapped. π«Ά
XSetPointerMapping can generate a BadValue error.
the XGetPointerMapping function returns the current mapping of the pointer. pointer buttons are numbered starting from one. XGetPointerMapping returns the number of physical buttons actually on the pointer. the nominal mapping for a pointer is map[i]=i+1. the nmap argument specifies the length of the array where the pointer mapping is returned, and only the first nmap elements are returned in map_return. so yeah, it's giving βread the map, but only as much as fits.β π
π DIAGNOSTICS π
BadValueβ some numeric value falls outside the range of values accepted by the request. unless a specific range is specified for an argument, the full range defined by the argument's type is accepted. any argument defined as a set of alternatives can generate this error. so if the number's giving βnot in my range,β that's this one. watch out. π¨
π¦ SEE ALSO π¦
XChangeKeyboardControl(3),XChangeKeyboardMapping(3)Xlib - C Language X Interface
X Version 11 Β· libX11 1.8.14 Β· XSetPointerMapping(3) β that's the footer sign-off, bestie: source/version and title, all wrapped up cute. bye! π«Άππ
π¦ where this page comes from
- alpine 3.24: libx11-doc 1.8.14-r0 Β· X11
- arch rolling: libx11 1.8.14-1 Β· MIT AND X11
- nixos 26.05: libx11 1.8.14
- nixpkgs unstable: libx11 1.8.14
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms