DMXGetInputAttributes(3)

πŸ“¦
version 1.1.5 Β· 2 versions
, in epel 10, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0

πŸ’– DMXGetInputAttributes β€” determine input device attributes πŸ’–

okay bestie, we're in the Library Functions Manual section of your local man pages, and today's main character is DMXGetInputAttributes(3). she's a libdmx girly, she's nosy in the best way, and she's about to tell you everything about your input devices. let's go πŸ¦‹


✨ SYNOPSIS ✨

#include <X11/extensions/dmxext.h>

Bool DMXGetInputAttributes(Display *dpy,
                           int id,
                           DMXInputAttributes *attr);

🌸 DESCRIPTION 🌸

so like, DMXGetInputAttributes() hands you back the tea about the input device you point at with id. and listen β€” this info? you literally cannot get it from the XListInputDevices(3) call. it's exclusive. it's VIP. πŸ™ˆ

id is the same id you'd use with the XListInputDevices(3) call, and it has to be in the range 0 to one less than whatever DMXGetInputCount(3) returned, inclusive. so like, stay in your lane, id-wise. πŸ’…

the DMXInputAttributes structure is:

typedef struct {
    DMXInputEnum inputType;
    int          physicalScreen;
    int          physicalId;
    Bool         isCore;
    Bool         sendsCore;
    const char   *name;
    Bool         detached;
} DMXInputAttributes;

inputType is always valid, no cap, and it'll be one of these depending on what kind of input we're dealing with: DMXLocalInputType, DMXConsoleInputType, or DMXBackendInputType. iconic little enum moment.

  • for local devices: every other field that comes back, except isCore and sendsCore, is invalid. don't trust them, they're just vibes at that point.
  • for console devices: physicalScreen and physicalID will be invalid, and name gives you the name of the X server where the console window is being displayed.
  • for back-end devices: physicalScreen identifies the back-end display and you can totally feed it to DMXGetScreenAttributes(3) to get more info; physicalId is the XInput device id on the back-end X server; and name is invalid β€” because it literally wouldn't tell you anything extra you couldn't already get from DMXGetScreenAttributes(3). redundant queen, we don't need her. πŸ’€

now for the core stuff, and this is important so pay attention:

  • if isCore is True, then this device is active as a true core input device and will send core events.
  • if sendsCore is True, then this device is an XInput extension device, but it sends core events instead of extension events.
heads up bestie β€” this behavior is different from XFree86 or Xorg, where XInput extension devices may send both extension events and core events. so don't go assuming. πŸ‘‘

and finally, if detached is True, then this device has been detached and is no longer producing input events. she's on a break. but you can reattach her using DMXAddInput(3). we love a comeback arc. πŸ”₯


🌈 RETURN VALUE 🌈

DMXGetInputAttributes() returns True unless there's a protocol error. simple as that. πŸŽ€

and if things go wrong? she can generate BadValue β€” specifically if the value of id is out of range. out of bounds, out of pocket. 🚫


⭐ SEE ALSO ⭐


lowkey that's the whole page, bestie. go read those SEE ALSOs, iykyk. 🫢

X Version 11 ✨ libdmx 1.1.5 β€” mwah, that's the version tag and date vibes, signing off πŸ’œπŸ§šβ€β™€οΈ