STRUCT MAGICMOUSE_SC(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ struct magicmouse_sc(9) ✨

okay so bestie, this is a page straight outta the Kernel API Manual β€” we're talking kernel-level, like, deep internals energy πŸ’… and it's all about one lil struct. buckle up πŸŽ€


🌸 NAME 🌸

struct magicmouse_sc β€” literally just tracks Magic Mouse-specific data. that's the whole vibe. it's the little struct that holds all the deets the driver needs to keep about your fancy mouse πŸ¦‹


πŸ’– SYNOPSIS πŸ’–

struct magicmouse_sc {
    struct input_dev *input;
    unsigned long quirks;
    int ntouches;
    int scroll_accel;
    unsigned long scroll_jiffies;
    struct {
      short x;
      short y;
      short scroll_x;
      short scroll_y;
      short scroll_x_hr;
      short scroll_y_hr;
      u8 size;
      bool scroll_x_active;
      bool scroll_y_active;
    } touches[16];
    int tracking_ids[16];
    struct hid_device *hdev;
    struct delayed_work work;
    struct timer_list battery_timer;
 };

like, look at her. she's got layers πŸ‘‘ a whole anonymous inner struct, stacked 16 deep, no cap.


πŸŽ€ Members πŸŽ€

  • input β€” the input device we report events through. this is the main character that actually gets your clicks and taps out into the world ✨
  • quirks β€” currently unused πŸ™ˆ yes bestie, she's sitting there, doing absolutely nothing, just vibing. (the field stays though, fr fr.)
  • ntouches β€” the number of touches in the most recent touch report. basically "how many fingers, bestie" πŸ’€
  • scroll_accel β€” number of consecutive scroll motions. it's counting how hard you're scrolling πŸ”₯
  • scroll_jiffies β€” the time of the last scroll motion. timestamped. tracked. observed. ⭐
  • touches β€” the most recent data for a touch, indexed by tracking ID. and inside each one you get x, y, scroll_x, scroll_y, scroll_x_hr, scroll_y_hr, size, scroll_x_active and scroll_y_active β€” like a whole tiny wardrobe of fields, 16 of them, extremely organized 🧚
  • tracking_ids β€” the mapping of current touch input data to touches. it's the group chat roster that tells you which touch is which 🫢
  • hdev β€” pointer to the underlying HID device. the real one. the source. πŸ’œ
  • work β€” a workqueue to handle initialization retry for quirky devices. yes, some mice are quirky. iconic of them honestly 🌈
  • battery_timer β€” timer for obtaining battery level information. gotta know when your mouse is running low before it betrays you 😭

πŸ¦‹ SEE ALSO πŸ¦‹

  • Kernel file ./drivers/hid/hid-magicmouse.c β€” go read the source bestie, iykyk πŸ‘‘

ngl this struct is small but she is doing the work. treat her fields with respect πŸ’…

okay that's the whole page!! brought to you by the ./drivers/hid girlies, dated October 2026 β€” stay quirky, track those touches, and remember: battery timers are self-care πŸ“βœ¨

πŸ“¦ where this page comes from