XSETDEVICEMODE(3)

✨ XSETDEVICEMODE(3) ✨

okay so bestie, welcome to XSetDeviceMode from the XSETDEVICEMODE(3) manual, she's giving input-device glow-up energy and honestly? iconic πŸ’…


🌸 NAME 🌸

XSetDeviceMode β€” change the mode of a device πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <X11/extensions/XInput.h>

XSetDeviceMode( Display *display,
                XDevice *device,
                int mode);
  • display β€” the connection to the X server, your little hotline to the mothership πŸ“ž
  • device β€” the device whose mode we're about to switch up, main character of this whole operation πŸ‘‘
  • mode β€” the mode itself, bestie. You can pass Absolute, or Relative. Those are the two, no third option, periodt ✨

πŸ’– DESCRIPTION πŸ’–

The XSetDeviceMode request changes the mode of an input device that is capable of reporting either absolute positional information or relative motion information. Like, it literally just flips the vibe of the device between "here's exactly where I am" and "here's how far I moved," iykyk πŸ¦‹

ngl though, not every device is built for this. Not all input devices are capable of reporting motion data, and not all are capable of changing modes from Absolute to Relative. So before you go feral with this request, just know your device might simply not be that girl πŸ™ˆ

XSetDeviceMode can generate a BadDevice or BadMode error. Yeah. She can be dramatic πŸ’€


πŸŽ€ DIAGNOSTICS πŸŽ€

  • BadDevice β€” an invalid device was specified, oops. The specified device does not exist or has not been opened by this client via XOpenInputDevice. This error may also occur if some other client has caused the specified device to become the X keyboard or X pointer device via the XChangeKeyboardDevice or XChangePointerDevice requests. Basically someone else claimed your fave, awkward 😭
  • BadMatch β€” this error may occur if an XSetDeviceMode request is made specifying a device that has no valuators and reports no axes of motion. Like bestie, there's nothing to measure here, what are we even doing πŸ’€
  • BadMode β€” an invalid mode was specified. This error will also be returned if the specified device is not capable of supporting the XSetDeviceMode request. Not everyone can sit with us, and that's okay 🌈

fr fr, remember: Absolute or Relative, that's the whole mode menu. Don't invent a third one, she will not slay πŸ’…

and that's the whole page, bestie!! this was XSETDEVICEMODE(3), dated 05/18/2026, and it lives in the XSETDEVICEMODE(3) manual section 🫢 go forth and set some device modes, you've got this, no cap πŸ’œβœ¨πŸŒΈ

πŸ“¦ where this page comes from