STRUCT MAGICMOUSE_SC(9)
β¨ 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 getx,y,scroll_x,scroll_y,scroll_x_hr,scroll_y_hr,size,scroll_x_activeandscroll_y_activeβ like a whole tiny wardrobe of fields, 16 of them, extremely organized π§tracking_idsβ the mapping of current touch input data totouches. 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
- 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