EVIOCGMTSLOTS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… EVIOCGMTSLOTS(9) β€” like, the Kernel API Manual one, bestie ✨

okay so real talk, this is EVIOCGMTSLOTS from section 9 of the kernel API docs, and it's lowkey one of the most useful little ioctls ever. it's giving "let me peek at your multitouch slots" and honestly? we love her for it. πŸŽ€


✨ NAME ✨

EVIOCGMTSLOTS β€” get MT slot values 🫢


🌸 SYNOPSIS 🌸

EVIOCGMTSLOTS (len );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • len β€” the size of the data buffer, in bytes. that's it, that's the whole argument, she's simple like that πŸ’…

πŸ”₯ DESCRIPTION πŸ”₯

so the ioctl buffer argument has to be, like, binary equivalent to this, no cap:

struct input_mt_request_layout { __u32 code; __s32 values[num_slots]; };

where num_slots is the (arbitrary) number of MT slots you wanna extract. and yeah, "arbitrary" is doing a lot of work in that sentence β€” you pick how many you want, the kernel respects it as long as your buffer math is right. ✨

the ioctl size argument (len) is the size of the buffer, and it should satisfy:

len = (num_slots + 1) * sizeof(__s32)

note the + 1, bestie β€” that's the code field riding along in the same buffer, don't forget her 😭. and if len is too small to fit all the available slots, no drama: the first num_slots are returned.

before the call, you set code to the wanted ABS_MT event type. on return, values[] is filled with the slot values for the specified ABS_MT code. that's the whole vibe check: you put in a code, you get back values. 🧚

🚨 and if the request code is not an ABS_MT value? -EINVAL gets returned at you. so like, please set code correctly, otherwise she will simply not. πŸ’€

πŸ‘‘ SEE ALSO πŸ‘‘

go check these out, they're all icons in their own right:

  • Kernel file ./include/uapi/linux/input.h
  • struct input_absinfo(9)
  • struct input_keymap_entry(9)
  • EVIOCGMASK(9)
  • EVIOCSMASK(9)
  • struct ff_replay(9)
  • struct ff_trigger(9)
  • struct ff_envelope(9)
  • struct ff_constant_effect(9)
  • struct ff_ramp_effect(9)
  • struct ff_condition_effect(9)
  • struct ff_periodic_effect(9)
  • struct ff_rumble_effect(9)
  • struct ff_haptic_effect(9)
  • struct ff_effect(9)

okay that's the whole page, mwah πŸ’– this gem lives in ./include/uapi/linux, dating from October 2026 β€” yes, the future, she's ahead of her time fr fr. now go get those slot values, periodt. 🌈⭐

πŸ“¦ where this page comes from