ir_establish_scancode(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 β€” the struct rc_dev device 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 πŸ“


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