Skip to content

Commit

Permalink
fw: hid_kbd ignore non key events
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiobaltieri committed Oct 7, 2024
1 parent 49b014d commit ae3d52e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions firmware/src/hid_kbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ static void hid_kbd_update_modifiers(uint8_t *modifiers, struct input_event *evt
{
uint8_t modifier;

if (evt->type != INPUT_EV_KEY) {
return;
}

modifier = input_to_hid_modifier(evt->code);
if (modifier != 0) {
if (evt->value) {
Expand All @@ -63,6 +67,10 @@ static int hid_kbd_update_bits(uint8_t bits[], struct input_event *evt)
uint8_t bit;
int hid_code;

if (evt->type != INPUT_EV_KEY) {
return 0;
}

hid_code = input_to_hid_code(evt->code);

off = hid_code / 8;
Expand Down

0 comments on commit ae3d52e

Please sign in to comment.