rc_g_keycode_from_table(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– rc_g_keycode_from_table(9) πŸ’–

okay bestie, welcome to the Kernel API Manual tea session β€” today's main character is rc_g_keycode_from_table, and yes she's exactly what her name says she is πŸŽ€


✨ NAME ✨

rc_g_keycode_from_table β€” gets the keycode that corresponds to a scancode 🌸

like, that's literally the whole job. scancode goes in, keycode comes out. iconic behavior honestly.


πŸ¦‹ SYNOPSIS πŸ¦‹

u32 rc_g_keycode_from_table (struct rc_dev *dev , u64 scancode );

copy it exactly like that, no cap πŸ”₯


πŸ’… ARGUMENTS πŸ’…

  • dev β€” the struct rc_dev descriptor of the device 🫢 that's your device's little ID card basically
  • scancode β€” the scancode to look for πŸ‘€ the thing you're hunting through the table for

🌈 DESCRIPTION 🌈

so here's the vibe: this routine is used by drivers which need to convert a scancode to a keycode. that's it, that's the function πŸ’œ

but bestie, listen β€” normally it should not be used, because drivers should have no interest in keycodes. like, that's not their lane. stay in your lane, driver. πŸ™ˆ

⭐ RETURN ⭐

the corresponding keycode, or KEY_RESERVED πŸŽ€

so if the search slays you get your keycode, and if it doesn't you get KEY_RESERVED. the end. periodt. πŸ’€


πŸ‘‘ SEE ALSO πŸ‘‘

kernel file ./drivers/media/rc/rc-main.c πŸ“ and the whole friend group:

scancode_to_u64(9), ir_create_table(9), ir_free_table(9), ir_resize_table(9), ir_update_mapping(9), ir_establish_scancode(9), ir_setkeycode(9), ir_setkeytable(9), ir_lookup_by_scancode(9), ir_getkeycode(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)

squad's all here, no one left behind 🫢✨


and that's a wrap!! this little page lives in ./drivers/media/rc, dated October 2026, brought to you by the Kernel API Manual β€” mwah, love u, go read rc-main.c πŸ’–πŸ§šπŸŒΈ

πŸ“¦ where this page comes from