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 πŸ¦‹


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