input_mt_get_slot_by_key(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

okay so bestie, gather round β€” this is input_mt_get_slot_by_key from the Kernel API Manual (section 9, we're fancy), and it literally does one iconic thing: return slot matching key. that's the whole vibe. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

int input_mt_get_slot_by_key (struct input_dev *dev , int key );

πŸŽ€ ARGUMENTS πŸŽ€

  • dev β€” the input device that's already got MT slots allocated. like, the slots have to exist already, no cap. 🫢
  • key β€” the key of the sought slot. the one you're out here looking for. πŸ”

🌸 DESCRIPTION 🌸

so here's the tea β˜• β€” this function returns the slot of the given key, if it exists. simple. if that key is not already chilling in some slot, it goes ahead and sets the key on the first unused slot and returns that one instead. lowkey efficient, we love to see it. ✨

and if there's no available slot to be found at all? yeah. -1 is returned. not great, not terrible, but that's the deal. 😭

πŸ’€ real talk moment: for this function to work properly, input_mt_sync_frame has to be called at each frame. like, every single frame. don't skip it, bestie, it's giving load-bearing. πŸ™ˆ

⭐ SEE ALSO ⭐

the kernel file lives at ./drivers/input/input-mt.c β€” go read it, it's the main character. πŸ‘‘

and the whole friend group of related functions:


🌈 that's the whole page, bestie β€” sourced straight from ./drivers/input, dated October 2026, and yes it's still input_mt_get_slot_by_key(9) at the bottom because we don't ghost our own footer. periodt. πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from