STRUCT INPUT_KEYMAP_ENTRY(9)
π struct input_keymap_entry(9) β the kernel manual, but make it make sense
okay bestie, so this is a page from the Kernel API Manual, and it's about one lil struct named struct input_keymap_entry that the kernel uses to talk about keymaps. she's not a big celebrity struct, but she's iconic in her own way π
β¨ NAME β¨
struct input_keymap_entry β the struct that's used by the EVIOCGKEYCODE/EVIOCSKEYCODE ioctls. that's literally her whole job, and she does it flawlessly π
π¦ SYNOPSIS π¦
here's the whole glow-up, exactly as she appears in the wild:
struct input_keymap_entry {
#define INPUT_KEYMAP_BY_INDEX (1 << 0);
__u8 flags;
__u8 len;
__u16 index;
__u32 keycode;
__u8 scancode[32];
};
like, she's serving struct realness. 32 bytes of scancode buffer. no notes. periodt β¨
πΈ Members πΈ
okay so these are the fields, and honestly each one is a lil main character:
flagsβ this is where you tell the kernel how she should handle the request. for example, setting theINPUT_KEYMAP_BY_INDEXflag indicates that the kernel should perform the lookup in the keymap by index instead of by scancode. so like, index girlies rise π«Άlenβ the length of the scancode that resides in thescancodebuffer. yes, she's literally just telling you how long the thing is. queen of clarity πindexβ the index in the keymap. this one may be used instead ofscancode. she's the alternative route, the backup plan, the understudy that sometimes gets the lead role πkeycodeβ the key code assigned to this scancode. this is the whole point of the operation ngl π₯scancodeβ scancode represented in machine-endian form. not network endian, not vibe endian, machine endian. write that down bestie π
π Description π
okay so boom β this structure is used to retrieve and modify keymap data. that's the tea β
users have the option of performing a lookup either by the scancode itself or by index in the keymap entry. two paths, same destination, choose your fighter β¨
and EVIOCGKEYCODE will also return the scancode or the index β depending on which element was used to perform the lookup. so she mirrors your energy right back at you. reciprocal queen π
π SEE ALSO π
the whole friend group, no cap:
- Kernel file
./include/uapi/linux/input.hstruct input_absinfo(9) EVIOCGMTSLOTS(9)EVIOCGMASK(9)EVIOCSMASK(9)struct ff_replay(9)struct ff_trigger(9)struct ff_envelope(9)struct ff_constant_effect(9)struct ff_ramp_effect(9)struct ff_condition_effect(9)struct ff_periodic_effect(9)struct ff_rumble_effect(9)struct ff_haptic_effect(9)struct ff_effect(9)
ngl go read those too, the lore is deep and the structs are lowkey everything π§
and that's the page, bestie!! this one came from ./include/uapi/linux, dated October 2026 β so yeah, mark your calendars, screenshot it, send it to the group chat π stay slay, stay machine-endian π
β¨
π¦ 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