Do not send uninitialized HID event
If the function returns false, then there is nothing to send.
This commit is contained in:
parent
8d4ea2bd37
commit
68982c73da
@ -43,7 +43,9 @@ sc_keyboard_uhid_synchronize_mod(struct sc_keyboard_uhid *kb) {
|
|||||||
atomic_store_explicit(&kb->device_mod, mod, memory_order_relaxed);
|
atomic_store_explicit(&kb->device_mod, mod, memory_order_relaxed);
|
||||||
|
|
||||||
struct sc_hid_event hid_event;
|
struct sc_hid_event hid_event;
|
||||||
sc_hid_keyboard_event_from_mods(&hid_event, diff);
|
if (!sc_hid_keyboard_event_from_mods(&hid_event, diff)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
LOGV("HID keyboard state synchronized");
|
LOGV("HID keyboard state synchronized");
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user