STRUCT ALPS_FIELDS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct alps_fields(9) β€” the kernel API manual, but make it cute πŸŽ€

okay so bestie, welcome to the struct alps_fields(9) page β€” this is from the Kernel API Manual, and honestly? it's giving decoded packet realness. no cap. ✨


🌸 NAME 🌸

struct alps_fields β€” literally the decoded version of the report packet. that's it. that's the whole vibe. the raw packet comes in, and this struct is what it looks like after it got decoded and understood, like when your group chat finally explains the drama. πŸ’€


✨ SYNOPSIS ✨

here's the whole shape of her, exactly as she is β€” do NOT touch the fields, they are iconic and load-bearing:

struct alps_fields {
    unsigned int x_map;
    unsigned int y_map;
    unsigned int fingers;
    int pressure;
    struct input_mt_pos st;
    struct input_mt_pos mt[MAX_TOUCHES];
    unsigned int first_mp:1;
    unsigned int is_mp:1;
    unsigned int left:1;
    unsigned int right:1;
    unsigned int middle:1;
    unsigned int ts_left:1;
    unsigned int ts_right:1;
    unsigned int ts_middle:1;
 };

and yes MAX_TOUCHES is a thing, don't come for me, it's in the original 🫢


πŸ¦‹ Members πŸ¦‹

a field-by-field vibe check, let's go:

  • x_map β€” bitmap of active X positions for MT. like a little attendance sheet for which X spots are showing up. πŸ“
  • y_map β€” bitmap of active Y positions for MT. same energy, but the Y axis this time. πŸ“
  • fingers β€” number of fingers for MT. yes bestie, we're counting. count them. πŸ–οΈ
  • pressure β€” pressure. that's the whole description. it's pressure. respect the brevity πŸ’…
  • st β€” position for ST. 🎯
  • mt β€” position for MT. 🎯
  • first_mp β€” packet is the first of a multi-packet report. main character of the packet sequence, lowkey. πŸ‘‘
  • is_mp β€” packet is part of a multi-packet report. it's in the ensemble cast, still slaying. ⭐
  • left β€” left touchpad button is active. πŸ”˜
  • right β€” right touchpad button is active. πŸ”˜
  • middle β€” middle touchpad button is active. πŸ”˜
  • ts_left β€” left trackstick button is active. πŸ•ΉοΈ
  • ts_right β€” right trackstick button is active. πŸ•ΉοΈ
  • ts_middle β€” middle trackstick button is active. πŸ•ΉοΈ

and yeah, all those :1 ones are single-bit bitfields β€” tiny little on/off queens. one bit each. efficient. we love her for it. 🧚


🌈 SEE ALSO 🌈

go read these next, iykyk β€” they're all in the kernel file ./drivers/input/mouse/alps.h:

  • struct alps_protocol_info(9)
  • struct alps_model_info(9)
  • struct alps_nibble_commands(9)
  • struct alps_data(9)

all of them live under ./drivers/input/mouse β€” that's the neighborhood, fr fr. 🏑


πŸ’€ real talk though: this page is about a kernel-internal struct, so nothing here is a promise to userspace. it's just the layout, exactly as written. don't go inventing fields, bestie, the compiler will not be nice about it. πŸ™ˆ

and that's the whole page!! 🌸 sign-off time: this cutie comes from ./drivers/input/mouse, dated October 2026, and the footer repped struct alps_fields(9) one more time for the people in the back. periodt. πŸŽ€πŸ«ΆπŸ’–

πŸ“¦ where this page comes from