input_mt_assign_slots(9)
β¨ input_mt_assign_slots(9) β¨
okay so bestie, welcome to the Kernel API Manual π this one's a <9>-section page, aka kernel-internals territory, aka the part of town where the multitouch magic happens π«Ά we're talking input_mt_assign_slots today and honestly? she's the matchmaker of the input subsystem π
πΈ NAME πΈ
input_mt_assign_slots β perform a best-match assignment β¨
like, she looks at your contacts and your slots and goes "okay you two, you're a couple now" π no cap.
π¦ SYNOPSIS π¦
int input_mt_assign_slots (struct input_dev *dev , int *slots , const
struct input_mt_pos *pos , int num_pos , int dmax );
yes the line break is real, that's just how the manpage renders it, don't come for her π copy it exactly, fr fr.
π ARGUMENTS π
devβ the input device that already has its MT slots allocated β¨. if you haven't allocated slots yet, bestie, go do that first, this function is not gonna do it for you πslotsβ the slot assignment array that's gonna get filled in π«Ά this is the output, the finished product, the glow-up πposβ the position array you want to match against πΈ these are the vibes we're trying to placenum_posβ how many positions are in that array, i.e. the headcount πdmaxβ the maximumABS_MT_POSITIONdisplacement allowed, and heads up: zero means infinite β so don't be passing0thinking it means "no movement allowed", it's literally the opposite, iykyk π
π₯ DESCRIPTION π₯
so what she does is: she runs a best match against the current contacts and hands you back the slot assignment list πβ¨. New contacts get assigned to unused slots β the way that a group chat adds a new member to the empty seat, very main character energy π
the assignments are balanced so that every single coordinate displacement stays below the euclidian distance dmax π that's the whole vibe check of the function. BUT β and this is important bestie β if no such assignment can be found, some contacts get assigned to unused slots anyway π she does her best, she doesn't just give up.
returns zero on success π₯³ or a negative error in case of failure π that's it, that's the contract.
π§ SEE ALSO π§
the kernel file lives at ./drivers/input/input-mt.c β go read it, she's iconic ππ and then check out her whole friend group:
input_mt_init_slots(9)input_mt_destroy_slots(9)input_mt_report_slot_state(9)input_mt_report_finger_count(9)input_mt_report_pointer_emulation(9)input_mt_drop_unused(9)input_mt_release_slots(9)input_mt_sync_frame(9)input_mt_get_slot_by_key(9)
π ok that's the whole page bestie, you've got this. match those slots, respect thedmax, and remember:0means infinite, not zero π«Άβ¨
huge slay to the kernel devs over at ./drivers/input β this one's dated October 2026 and it's input_mt_assign_slots(9) forever and always ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms