ir_establish_scancode(9)
π ir_establish_scancode β a.k.a. the "put a keycode in the table bestie" era
okay so first things first, this is page ir_establish_scancode(9) from the Kernel API Manual, and honestly? she's a little baddie that just wants to put a scancode in a table. iconic behaviour, no notes. π
β¨ NAME β¨
ir_establish_scancode β set a keycode in the scancode->keycode table π¦
Like, that's it. That's her whole job. She sets a keycode in the scancode->keycode table and she does it slayfully.
β¨ SYNOPSIS β¨
unsigned int ir_establish_scancode (struct rc_dev *dev , struct rc_map
*rc_map , u64 scancode , bool resize );
look at her go π«Ά four args, one return value, zero drama.
β¨ ARGUMENTS β¨
devβ thestruct rc_devdevice descriptor. it's giving "who am I doing this for", and the answer is this device right here πrc_mapβ the scancode table to be searched. this is the little hangout spot where all the scancodes live πΈscancodeβ the desired scancode. the one we're manifesting β¨resizeβ controls whether we're allowed to resize the table to accommodate not-yet-present scancodes. so likeβ¦ are we allowed to knock down a wall and add a extra bedroom for a scancode that doesn't have a spot yet? this bool decides π§
β¨ DESCRIPTION β¨
okay so the tea β: this routine is used to locate a given scancode in rc_map. she goes looking, she snoops around the table, very main character energy.
and if the scancode is not yet present? no worries bestie, the routine will allocate a new slot for it. she literally builds a whole new seat at the table. that's growth. that's construction. that's lowkey iconic π
ngl this is why resize matters β whether she's allowed to expand the table is entirely up to that bool, so don't be surprised if the vibe check fails on a table that can't grow π
β¨ RETURN β¨
she returns the index of the mapping containing the scancode in question β cute, precise, useful π
or -1U in case of failure π which is the kernel way of saying "she did not slay today".
β¨ SEE ALSO β¨
the whole friend group, fr fr β plus the kernel file they all hang out in: ./drivers/media/rc/rc-main.c π
scancode_to_u64(9)ir_create_table(9)ir_free_table(9)ir_resize_table(9)ir_update_mapping(9)ir_setkeycode(9)ir_setkeytable(9)ir_lookup_by_scancode(9)ir_getkeycode(9)rc_g_keycode_from_table(9)ir_do_keyup(9)rc_keyup(9)ir_timer_keyup(9)ir_timer_repeat(9)rc_repeat(9)ir_do_keydown(9)rc_keydown(9)rc_keydown_notimeout(9)rc_validate_scancode(9)rc_validate_filter(9)struct rc_filter_attribute(9)show_protocols(9)parse_protocol_change(9)store_protocols(9)show_filter(9)store_filter(9)show_wakeup_protocols(9)store_wakeup_protocols(9)
and that's the page!! π source is ./drivers/media/rc, dated October 2026 β so she's fresh, she's current, she's got that new-manpage smell π byeee, go set some keycodes responsibly π
π¦ 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