From abce9deab76124d72c61a824aaa1affc3dbc1260 Mon Sep 17 00:00:00 2001 From: Solodros <34903426+Solodros@users.noreply.github.com> Date: Thu, 8 Jan 2026 06:16:24 +0800 Subject: [PATCH] fix(hid): initialize missing d_scroll_x field in mouse report (#3196) The static mouse_report definition did not initialize the d_scroll_x field. The zmk_hid_mouse_report_body structure contains five fields (buttons, d_x, d_y, d_scroll_y, d_scroll_x), but d_scroll_x was left uninitialized. Initialize d_scroll_x to 0 to ensure all fields in the mouse report are properly initialized and avoid potential undefined behavior. --- app/src/hid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/hid.c b/app/src/hid.c index cf5a557f8..d8700c3f4 100644 --- a/app/src/hid.c +++ b/app/src/hid.c @@ -29,7 +29,7 @@ static uint8_t keys_held = 0; static struct zmk_hid_mouse_report mouse_report = { .report_id = ZMK_HID_REPORT_ID_MOUSE, - .body = {.buttons = 0, .d_x = 0, .d_y = 0, .d_scroll_y = 0}}; + .body = {.buttons = 0, .d_x = 0, .d_y = 0, .d_scroll_y = 0, .d_scroll_x = 0}}; #endif // IS_ENABLED(CONFIG_ZMK_POINTING)