STRUCT INPUT_HANDLE(9)
π struct input_handle(9)
okay so bestie, welcome to the Kernel API Manual β this is the page for struct input_handle, and honestly? it's giving matchmaker. no cap.
β¨ NAME β¨
struct input_handle β the literal link between an input device and an input handler π«Ά like it's the group chat that connects the two of them
πΈ SYNOPSIS πΈ
struct input_handle {
void *private;
int open;
const char *name;
struct input_dev *dev;
struct input_handler *handler;
unsigned int (*handle_events)(struct input_handle *handle, struct
input_value *vals, unsigned int count);
struct list_head d_node;
struct list_head h_node;
};
π Members π
okay bestie, here's the member-by-member vibe check, every single one, no skipping π€
privateβ handler-specific data π it's your little stash, the handler gets to put whatever it wants in here and the struct doesn't ask questionsopenβ a counter showing whether the handle is 'open', i.e. whether it should be delivering events from its device π so like. is it serving looks or is it asleepnameβ the name the handler that created this handle gave it π·οΈ it's the handle's name, gifted by its makerdevβ the input device this handle is attached to π the actual device it's linked up withhandlerβ the handler that works with the device through this handle π€ that's the whole point of the handle, it's the middle bestiehandle_eventsβ the event sequence handler π¬ this one's set up by the input core according to the event handling method specified in the handler. seeinput_handle_setup_event_handler. ok and here's the important bit, pay attention: this method is being called by the input core with interrupts disabled anddev->event_lockspinlock held and so it may not sleep π΄π« like fr fr, it may NOT sleep. do not make it sleep. it cannot sleep.d_nodeβ used to put the handle on the device's list of attached handles π device-side bookkeepingh_nodeβ used to put the handle on the handler's list of handles from which it gets events π handler-side bookkeeping
π¦ SEE ALSO π¦
go read these next, i'm obsessed with the whole little ecosystem:
- Kernel file
./include/linux/input.h struct input_value(9)struct input_dev(9)struct input_handler(9)input_set_events_per_packet(9)struct ff_device(9)
π reminder bestie:handle_eventsruns with interrupts disabled and thedev->event_lockspinlock held. it may not sleep. that's not a suggestion, that's the whole rule.
k that's the page! this iconic little document lives in ./include/linux and it's dated October 2026 β mwah, slay, periodt π
β¨π
π¦ 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