mirror of https://github.com/zmkfirmware/zmk.git
fix(hid): Fix scroll value truncation (#2865)
Fix 8 bit truncation of 16 bit scroll values when passed into functions `zmk_hid_mouse_scroll_set` and `zmk_hid_mouse_scroll_update`. Fixes: #2864 Co-authored-by: Tobias Adolph <43353209+adolto@users.noreply.github.comgit>
This commit is contained in:
parent
84772ebf14
commit
2c0e7daced
|
|
@ -377,9 +377,9 @@ int zmk_hid_mouse_button_release(zmk_mouse_button_t button);
|
|||
int zmk_hid_mouse_buttons_press(zmk_mouse_button_flags_t buttons);
|
||||
int zmk_hid_mouse_buttons_release(zmk_mouse_button_flags_t buttons);
|
||||
void zmk_hid_mouse_movement_set(int16_t x, int16_t y);
|
||||
void zmk_hid_mouse_scroll_set(int8_t x, int8_t y);
|
||||
void zmk_hid_mouse_scroll_set(int16_t x, int16_t y);
|
||||
void zmk_hid_mouse_movement_update(int16_t x, int16_t y);
|
||||
void zmk_hid_mouse_scroll_update(int8_t x, int8_t y);
|
||||
void zmk_hid_mouse_scroll_update(int16_t x, int16_t y);
|
||||
void zmk_hid_mouse_clear(void);
|
||||
|
||||
#endif // IS_ENABLED(CONFIG_ZMK_POINTING)
|
||||
|
|
|
|||
|
|
@ -445,7 +445,7 @@ void zmk_hid_mouse_movement_update(int16_t hwheel, int16_t wheel) {
|
|||
LOG_DBG("Mouse movement updated to %d/%d", mouse_report.body.d_x, mouse_report.body.d_y);
|
||||
}
|
||||
|
||||
void zmk_hid_mouse_scroll_set(int8_t hwheel, int8_t wheel) {
|
||||
void zmk_hid_mouse_scroll_set(int16_t hwheel, int16_t wheel) {
|
||||
mouse_report.body.d_scroll_x = hwheel;
|
||||
mouse_report.body.d_scroll_y = wheel;
|
||||
|
||||
|
|
@ -453,7 +453,7 @@ void zmk_hid_mouse_scroll_set(int8_t hwheel, int8_t wheel) {
|
|||
mouse_report.body.d_scroll_y);
|
||||
}
|
||||
|
||||
void zmk_hid_mouse_scroll_update(int8_t hwheel, int8_t wheel) {
|
||||
void zmk_hid_mouse_scroll_update(int16_t hwheel, int16_t wheel) {
|
||||
mouse_report.body.d_scroll_x += hwheel;
|
||||
mouse_report.body.d_scroll_y += wheel;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue