@@ -37,6 +37,31 @@ bool hid_usb_kb_release(void* inst, uint16_t button) {
37
37
return furi_hal_hid_kb_release (button );
38
38
}
39
39
40
+ bool hid_usb_mouse_press (void * inst , uint8_t button ) {
41
+ UNUSED (inst );
42
+ return furi_hal_hid_mouse_press (button );
43
+ }
44
+
45
+ bool hid_usb_mouse_release (void * inst , uint8_t button ) {
46
+ UNUSED (inst );
47
+ return furi_hal_hid_mouse_release (button );
48
+ }
49
+
50
+ bool hid_usb_mouse_scroll (void * inst , int8_t delta ) {
51
+ UNUSED (inst );
52
+ return furi_hal_hid_mouse_scroll (delta );
53
+ }
54
+
55
+ bool hid_usb_mouse_move (void * inst , int8_t dx , int8_t dy ) {
56
+ UNUSED (inst );
57
+ return furi_hal_hid_mouse_move (dx , dy );
58
+ }
59
+
60
+ bool hid_usb_mouse_release_all (void * inst ) {
61
+ UNUSED (inst );
62
+ return furi_hal_hid_mouse_release (0 );
63
+ }
64
+
40
65
bool hid_usb_consumer_press (void * inst , uint16_t button ) {
41
66
UNUSED (inst );
42
67
return furi_hal_hid_consumer_key_press (button );
@@ -51,6 +76,7 @@ bool hid_usb_release_all(void* inst) {
51
76
UNUSED (inst );
52
77
bool state = furi_hal_hid_kb_release_all ();
53
78
state &= furi_hal_hid_consumer_key_release_all ();
79
+ state &= hid_usb_mouse_release_all (inst );
54
80
return state ;
55
81
}
56
82
@@ -67,6 +93,10 @@ static const BadUsbHidApi hid_api_usb = {
67
93
68
94
.kb_press = hid_usb_kb_press ,
69
95
.kb_release = hid_usb_kb_release ,
96
+ .mouse_press = hid_usb_mouse_press ,
97
+ .mouse_release = hid_usb_mouse_release ,
98
+ .mouse_scroll = hid_usb_mouse_scroll ,
99
+ .mouse_move = hid_usb_mouse_move ,
70
100
.consumer_press = hid_usb_consumer_press ,
71
101
.consumer_release = hid_usb_consumer_release ,
72
102
.release_all = hid_usb_release_all ,
@@ -157,6 +187,27 @@ bool hid_ble_kb_release(void* inst, uint16_t button) {
157
187
return ble_profile_hid_kb_release (ble_hid -> profile , button );
158
188
}
159
189
190
+ bool hid_ble_mouse_press (void * inst , uint8_t button ) {
191
+ BleHidInstance * ble_hid = inst ;
192
+ furi_assert (ble_hid );
193
+ return ble_profile_hid_mouse_press (ble_hid -> profile , button );
194
+ }
195
+ bool hid_ble_mouse_release (void * inst , uint8_t button ) {
196
+ BleHidInstance * ble_hid = inst ;
197
+ furi_assert (ble_hid );
198
+ return ble_profile_hid_mouse_release (ble_hid -> profile , button );
199
+ }
200
+ bool hid_ble_mouse_scroll (void * inst , int8_t delta ) {
201
+ BleHidInstance * ble_hid = inst ;
202
+ furi_assert (ble_hid );
203
+ return ble_profile_hid_mouse_scroll (ble_hid -> profile , delta );
204
+ }
205
+ bool hid_ble_mouse_move (void * inst , int8_t dx , int8_t dy ) {
206
+ BleHidInstance * ble_hid = inst ;
207
+ furi_assert (ble_hid );
208
+ return ble_profile_hid_mouse_move (ble_hid -> profile , dx , dy );
209
+ }
210
+
160
211
bool hid_ble_consumer_press (void * inst , uint16_t button ) {
161
212
BleHidInstance * ble_hid = inst ;
162
213
furi_assert (ble_hid );
@@ -174,6 +225,7 @@ bool hid_ble_release_all(void* inst) {
174
225
furi_assert (ble_hid );
175
226
bool state = ble_profile_hid_kb_release_all (ble_hid -> profile );
176
227
state &= ble_profile_hid_consumer_key_release_all (ble_hid -> profile );
228
+ state &= ble_profile_hid_mouse_release_all (ble_hid -> profile );
177
229
return state ;
178
230
}
179
231
@@ -191,6 +243,10 @@ static const BadUsbHidApi hid_api_ble = {
191
243
192
244
.kb_press = hid_ble_kb_press ,
193
245
.kb_release = hid_ble_kb_release ,
246
+ .mouse_press = hid_ble_mouse_press ,
247
+ .mouse_release = hid_ble_mouse_release ,
248
+ .mouse_scroll = hid_ble_mouse_scroll ,
249
+ .mouse_move = hid_ble_mouse_move ,
194
250
.consumer_press = hid_ble_consumer_press ,
195
251
.consumer_release = hid_ble_consumer_release ,
196
252
.release_all = hid_ble_release_all ,
0 commit comments