Skip to content

Commit

Permalink
Input: atkbd - correct MSC_SCAN events for force_release keys
Browse files Browse the repository at this point in the history
Without the change either no scancode would be reported on release of
force_release keys, or - if the key is marked as force_release erroneously
- the release event and the scancode would be reported in separate reports
to the input layer.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
  • Loading branch information
Stefan Brüns authored and Dmitry Torokhov committed Nov 17, 2014
1 parent b1cfa7b commit 5447326
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/input/keyboard/atkbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -456,8 +456,9 @@ static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data,

keycode = atkbd->keycode[code];

if (keycode != ATKBD_KEY_NULL)
input_event(dev, EV_MSC, MSC_SCAN, code);
if (!(atkbd->release && test_bit(code, atkbd->force_release_mask)))
if (keycode != ATKBD_KEY_NULL)
input_event(dev, EV_MSC, MSC_SCAN, code);

switch (keycode) {
case ATKBD_KEY_NULL:
Expand Down Expand Up @@ -511,6 +512,7 @@ static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data,
input_sync(dev);

if (value && test_bit(code, atkbd->force_release_mask)) {
input_event(dev, EV_MSC, MSC_SCAN, code);
input_report_key(dev, keycode, 0);
input_sync(dev);
}
Expand Down

0 comments on commit 5447326

Please sign in to comment.