ir_mce_kbd_encode(9)
π ir_mce_kbd_encode(9)
okay so bestie, welcome to the Kernel API Manual β yes, the actual kernel, and yes, this is the page that teaches you how to encode a scancode into a stream of raw IR events. it's giving "i speak fluent infrared" energy and honestly? iconic. π¦
β¨ NAME β¨
ir_mce_kbd_encode β Encode a scancode as a stream of raw events π‘
like, you hand it a scancode, and it hands you back a whole lil stream of raw events. match made in heaven, fr fr.
πΈ SYNOPSIS πΈ
int ir_mce_kbd_encode (enum rc_proto protocol , u32 scancode , struct
ir_raw_event *events , unsigned int max );
read it like a recipe, babes β four ingredients, one int coming back out the other side. π
π ARGUMENTS π
protocolβ the protocol to encode. this is the one telling us which flavour of IR we're cooking with πscancodeβ the scancode to encode. the star of the show, the main character, the whole point πeventsβ array of raw ir events to write into. this is the lil canvas you're painting on π¨maxβ maximum size ofevents. the vibe check on how much room you actually have π«Ά
π RETURN π
the number of events written. that's it, that's the win. β¨
but if there isn't enough space in the array to fit the encoding, you get -ENOBUFS π β and ngl, in that case all max events will have been written, so likeβ¦ it tried its best, it really did. π
π¦ SEE ALSO π¦
- Kernel file
./drivers/media/rc/ir-mce_kbd-decoder.c ir_mce_kbd_decode(9)β the decoding counterpart, the other half of the duo, the enemies-to-lovers of kernel IR code π
lowkey a reminder that-ENOBUFSstill writes everything up tomaxβ so check that return value, bestie, don't just vibe past it π
that's the whole page, periodt. π source vibes come from ./drivers/media/rc, dated October 2026, and the page itself is ir_mce_kbd_encode(9) β slay, go forth and encode 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