Skip to content

Commit

Permalink
HID: asus: filter G713/G733 key event to prevent shutdown
Browse files Browse the repository at this point in the history
[ Upstream commit c980512 ]

The G713 and G733 both emit an unexpected keycode on some key
presses such as Fn+Pause. The device in this case is emitting
two events on key down, and 3 on key up, the third key up event
is report ID 0x02 and is unfiltered, causing incorrect event.

This patch filters out the single problematic event.

Signed-off-by: Luke D Jones <luke@ljones.dev>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
flukejones authored and gregkh committed Jun 18, 2021
1 parent cb33cde commit 96cf492
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drivers/hid/hid-asus.c
Expand Up @@ -355,6 +355,16 @@ static int asus_raw_event(struct hid_device *hdev,
return -1;
}
}
if (drvdata->quirks & QUIRK_ROG_NKEY_KEYBOARD) {
/*
* G713 and G733 send these codes on some keypresses, depending on
* the key pressed it can trigger a shutdown event if not caught.
*/
if(data[0] == 0x02 && data[1] == 0x30) {
return -1;
}
}

}

return 0;
Expand Down

0 comments on commit 96cf492

Please sign in to comment.