input_event(9)
π 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
- 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