STRUCT INPUT_HANDLE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 questions
  • open β€” 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 asleep
  • name β€” the name the handler that created this handle gave it 🏷️ it's the handle's name, gifted by its maker
  • dev β€” the input device this handle is attached to πŸ”Œ the actual device it's linked up with
  • handler β€” the handler that works with the device through this handle 🀝 that's the whole point of the handle, it's the middle bestie
  • handle_events β€” the event sequence handler 🎬 this one's set up by the input core according to the event handling method specified in the handler. see input_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 and dev->event_lock spinlock 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 bookkeeping
  • h_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_events runs with interrupts disabled and the dev->event_lock spinlock 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