Skip to contentSkip to conversation

Input: cros_ec_keyb - send 'scancodes' in addition to key events

PATCH In review Dmitry Torokhov 2 participants 2 messages Dec 8, 2020

Subsystems (3)
lore
Share & tools
lore

Dmitry Torokhov

author maintainer
#0 lore raw

PATCH 1/1 Input: cros_ec_keyb - send 'scancodes' in addition to key events

To let userspace know what 'scancodes' should be used in EVIOCGKEYCODE and EVIOCSKEYCODE ioctls, we should send EV_MSC/MSC_SCAN events in addition to EV_KEY/KEY_* events. The driver already declared MSC_SCAN capability, so it is only matter of actually sending the events.

---
 drivers/input/keyboard/cros_ec_keyb.c | 1 +
 1 file changed, 1 insertion(+)
drivers/input/keyboard/cros_ec_keyb.c +1 -0
index 023f083dadd3..354d74d62f05 100644
@@ -184,6 +184,7 @@ static void cros_ec_keyb_process(struct cros_ec_keyb *ckdev,
 					"changed: [r%d c%d]: byte %02x\n",
 					row, col, new_state);
 
+				input_event(idev, EV_MSC, MSC_SCAN, pos);
 				input_report_key(idev, keycodes[pos],
 						 new_state);
 			}
Signature · 5 lines
2.29.2.576.ga3fc446d84-goog


-- 
Dmitry
#1 lore raw
Quoted 7 lines · Dmitry Torokhov

To let userspace know what 'scancodes' should be used in EVIOCGKEYCODE and EVIOCSKEYCODE ioctls, we should send EV_MSC/MSC_SCAN events in addition to EV_KEY/KEY_* events. The driver already declared MSC_SCAN capability, so it is only matter of actually sending the events.

FWIW, Acked-by: Rajat Jain <[email protected]>

Quoted 22 lines
---
 drivers/input/keyboard/cros_ec_keyb.c | 1 +
 1 file changed, 1 insertion(+)
drivers/input/keyboard/cros_ec_keyb.c +1 -1
index 023f083dadd3..354d74d62f05 100644
@@ -184,6 +184,7 @@ static void cros_ec_keyb_process(struct cros_ec_keyb *ckdev,
                                        "changed: [r%d c%d]: byte %02x\n",
                                        row, col, new_state);
 
+                               input_event(idev, EV_MSC, MSC_SCAN, pos);
                                input_report_key(idev, keycodes[pos],
                                                 new_state);
                        }
--

2.29.2.576.ga3fc446d84-goog

--
Dmitry