get_n_events_by_type(9)
π get_n_events_by_type β a Kernel API Manual (section 9) moment π
okay bestie, so this one lives in the Kernel API Manual, section 9, and it's genuinely such a little icon. it does exactly one thing and it does it slayfully. let's get into it β¨
πΈ NAME πΈ
get_n_events_by_type β returns maximum number of events per @type π
like... that's it. that's the whole job. and she ate.
π¦ SYNOPSIS π¦
int get_n_events_by_type (int type );
so you call her, you hand her an int type, and she hands you back an int. simple. clean. no cap. π
π ARGUMENTS π
typeβ type of button (EV_KEY,EV_SW) π«Ά like, which kind of button energy are we talking about here
β¨ DESCRIPTION β¨
okay so here's the vibe check: the return value of this function can be used to allocate a bitmap large enough to hold all bits for the given type. π«
literally that's the whole point β you ask her "how many events we talking for this type?", she tells you, and you go allocate a bitmap that's big enough to hold all the bits for that type. no overflow, no clownery, no "oops I under-allocated" π she's basically your allocation bestie. the main character of "how much memory do I need". π₯
π SEE ALSO π
- Kernel file
./drivers/input/keyboard/gpio_keys.cβ go read the source, iykyk π get_bm_events_by_type(9)πgpio_keys_disable_button(9)πgpio_keys_enable_button(9)βgpio_keys_attr_show_helper(9)πgpio_keys_attr_store_helper(9)π
so yeah, that's her. go forth and allocate responsibly, bestie π§ββοΈπ
mwah π β brought to you by ./drivers/input/keyboard, dated October 2026, and filed under get_n_events_by_type(9) in the Kernel API Manual. 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