input_event(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– input_event(9) β€” the "Kernel API Manual" one πŸ’–

okay so bestie, picture this: it's a manual page from the Kernel API Manual, it's called input_event, and it's literally the whole personality of every input driver out there. buckle up πŸŽ€


✨ NAME ✨

input_event β€” report new input event 🌸

like, "hey kernel, something happened" β€” that's the whole job, no cap.


πŸ¦‹ SYNOPSIS πŸ¦‹

void input_event (struct input_dev *dev , unsigned int type , unsigned
       int code , int value );

yes it really is spelled out like that, spacing and all, she's iconic πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • dev β€” device that generated the event πŸ‘‘ (the main character of this whole situation)
  • type β€” type of the event ✨
  • code β€” event code πŸ“
  • value β€” value of the event πŸ’œ

πŸ’… DESCRIPTION πŸ’…

This function should be used by drivers implementing various input devices to report input events. no because that's literally the assignment β€” if you're writing a driver for some input device, this is the function you reach for when you've got something to say. 🫢

See also input_inject_event. yep, that's the vibe, go look at her too πŸ”₯


🌈 NOTE 🌈

ok this part is lowkey important so listen up πŸ™ˆ

input_event may be safely used right after the input device was allocated with input_allocate_device, even before it is registered with input_register_device β€” but heads up, the event will not reach any of the input handlers. 😭

so yes, you can call it super early, it's fine, nobody's mad. Such early invocation of input_event may be used to 'seed' initial state of a switch or initial position of absolute axis, etc. β€” i.e. setting the starting vibe before anyone's watching. ⭐

fr fr though: early = safe, but early = nobody hears it. seeding, not announcing. πŸ“£

πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./drivers/input/input.c input_inject_event(9), input_alloc_absinfo(9), input_copy_abs(9), input_grab_device(9), input_release_device(9), input_open_device(9), input_close_device(9), input_scancode_to_scalar(9), input_default_setkeycode(9), input_get_keycode(9), input_set_keycode(9), input_reset_device(9), input_allocate_device(9), devm_input_allocate_device(9), input_free_device(9), input_set_timestamp(9), input_get_timestamp(9), input_set_capability(9), input_enable_softrepeat(9), input_register_device(9), input_unregister_device(9), input_register_handler(9), input_unregister_handler(9), input_handler_for_each_handle(9), input_register_handle(9), input_unregister_handle(9), input_get_new_minor(9), input_free_minor(9) β€” that's the whole friend group, go say hi πŸ¦‹


and that's the page!! πŸ’– this one lives in ./drivers/input, dated October 2026, filed under input_event(9). slay, periodt, go report some events bestie πŸ‘‘βœ¨

πŸ“¦ where this page comes from