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.
This commit is contained in:
Solodros 2026-01-08 06:16:24 +08:00 committed by GitHub
parent 36dbf46764
commit abce9deab7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -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)