XChangePointerControl(3)

πŸ’… XChangePointerControl(3) β€” the XLIB FUNCTIONS girlies

okay so bestie, welcome to the manual page for XChangePointerControl and XGetPointerControl, two of the most underrated little functions in XLIB FUNCTIONS land. their whole job? literally controlling pointer behavior. that's the vibe. pointer acceleration, pointer threshold, the whole thing. no cap. πŸ–±οΈβœ¨


✨ SYNTAX ✨

like, here's exactly how you call them, character for character, don't @ me:

int XChangePointerControl(Display *display, Bool do_accel, Bool
       do_threshold, int accel_numerator, int accel_denominator, int
       threshold);

int XGetPointerControl(Display *display, int *accel_numerator_return,
       int *accel_denominator_return, int *threshold_return);

πŸŽ€ ARGUMENTS πŸŽ€

every single one, bestie, we're not skipping a single one:

  • accel_denominator β€” specifies the denominator for the acceleration multiplier. yes girl, the bottom of the fraction πŸ’…
  • accel_denominator_return β€” returns the denominator for the acceleration multiplier. it's the same thing but it's giving output parameter, y'know?
  • accel_numerator β€” specifies the numerator for the acceleration multiplier. the top half, the main character of the fraction ✨
  • accel_numerator_return β€” returns the numerator for the acceleration multiplier. matching set, we love a duo 🫢
  • display β€” specifies the connection to the X server. the link, the connection, the situationship with your X server πŸ’–
  • do_accel β€” specifies a Boolean value that controls whether the values for the accel_numerator or accel_denominator are used. it's a yes/no gate, so iconic of it
  • do_threshold β€” specifies a Boolean value that controls whether the value for the threshold is used. another gate, another slay πŸšͺ
  • threshold β€” specifies the acceleration threshold. the pixel count that decides when the magic kicks in
  • threshold_return β€” returns the acceleration threshold. the read-back version 🌸

πŸ’– DESCRIPTION πŸ’–

so XChangePointerControl defines how the pointing device moves. that's the whole assignment, bestie. the acceleration, expressed as a fraction, is a multiplier for movement. for example, specifying 3/1 means the pointer moves three times as fast as normal. THREE TIMES. fast af. πŸ”₯

and here's the tea: the fraction may be rounded arbitrarily by the X server. so don't come crying to me if your 7/3 becomes something else, the server does what it wants, it's giving main character energy on its own terms.

acceleration only takes effect if the pointer moves more than threshold pixels at once, and it only applies to the amount beyond the value in the threshold argument. so like, it's not retroactive, it's selective. we stan a selective queen. πŸ‘‘

setting a value to -1 restores the default. that's the reset button, the "never mind, back to factory settings" of it all.

the values of the do_accel and do_threshold arguments must be True for the pointer values to be set, or the parameters are unchanged. literally the gates have to be open or nothing happens, that's just how it is. πŸ™ˆ

⚠️ negative values (other than -1) generate a BadValue error, as does a zero value for the accel_denominator argument. so like, -1 is cute and fine, -47 is not. and dividing by zero? absolutely not, we do not do that here, that's a BadValue too. πŸ’€

XChangePointerControl can generate a BadValue error. periodt.

and then we have XGetPointerControl, which returns the pointer's current acceleration multiplier and acceleration threshold. it's the little sister who just tells you what's going on. no changing, just reporting. honest queen. πŸ¦‹


🌈 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 basically, if the number's out of pocket, you get this. no cap. ⭐

πŸ‘‘ SEE ALSO πŸ‘‘

  • Xlib - C Language X Interface β€” the big book, the source text, the required reading. iykyk πŸ“š

okay that's the whole page bestie, go forth and accelerate your pointer responsibly πŸ’œ

this little gem came to you courtesy of X Version 11 and libX11 1.8.14, and like, huge shoutout to the XChangePointerControl(3) page for being the moment. mwah. πŸŽ€πŸ§šβ€β™€οΈ

πŸ“¦ where this page comes from