@@ -46,6 +46,7 @@ struct BtMouse {
46
46
47
47
#define MOUSE_MOVE_SHORT 5
48
48
#define MOUSE_MOVE_LONG 20
49
+ #define MOUSE_SCROLL 20
49
50
50
51
static void bt_mouse_notify_event (BtMouse * bt_mouse ) {
51
52
FuriThreadId thread_id = furi_thread_get_id (bt_mouse -> thread );
@@ -82,13 +83,13 @@ static void bt_mouse_process(BtMouse* bt_mouse, InputEvent* event) {
82
83
void * model ,
83
84
{
84
85
UNUSED (model );
85
- if (event -> key == InputKeyUp ) {
86
+ if (event -> key == InputKeyLeft ) {
86
87
if (event -> type == InputTypePress ) {
87
88
bt_mouse_button_state (bt_mouse , HID_MOUSE_BTN_LEFT , true);
88
89
} else if (event -> type == InputTypeRelease ) {
89
90
bt_mouse_button_state (bt_mouse , HID_MOUSE_BTN_LEFT , false);
90
91
}
91
- } else if (event -> key == InputKeyDown ) {
92
+ } else if (event -> key == InputKeyRight ) {
92
93
if (event -> type == InputTypePress ) {
93
94
bt_mouse_button_state (bt_mouse , HID_MOUSE_BTN_RIGHT , true);
94
95
} else if (event -> type == InputTypeRelease ) {
@@ -100,6 +101,14 @@ static void bt_mouse_process(BtMouse* bt_mouse, InputEvent* event) {
100
101
} else if (event -> type == InputTypeRelease ) {
101
102
bt_mouse_button_state (bt_mouse , HID_MOUSE_BTN_WHEEL , false);
102
103
}
104
+ } else if (event -> key == InputKeyUp ) {
105
+ if (event -> type == InputTypePress ) {
106
+ bt_mouse -> wheel = MOUSE_SCROLL ;
107
+ }
108
+ } else if (event -> key == InputKeyDown ) {
109
+ if (event -> type == InputTypePress ) {
110
+ bt_mouse -> wheel = - MOUSE_SCROLL ;
111
+ }
103
112
}
104
113
},
105
114
true);
0 commit comments