Can I change the keycodes on a keyboard?

0

1

I have a Lenovo notebook with a nonstandard keyboard layout in which there's a slash/question (/?) key next to the righthand Shift, that by br-abnt2 default was mapped to apostrophe/quote ('"). There's also a standard apostrophe/quote key next to 1. Yesterday I changed my br-abnt.map and my xorg layout files so as to fix the /? key. Then I realized the '" now was mapped to /?.

Today I tested these two keys with xev and they have the same keycode, so I can/t fix one without messing up the other.

Is it possible to change the keycodes on these keys so that they can be configured separatedly? How can I fix this?

EDIT: here's the evtest output for pressin first '" then /?:

Properties: Testing ... (interrupt to exit) Event: time 1525650895.009067, type 4 (EV_MSC), code 4 (MSC_SCAN), value 1c Event: time 1525650895.009067, type 1 (EV_KEY), code 28 (KEY_ENTER), value 0 Event: time 1525650895.009067, -------------- SYN_REPORT ------------ Event: time 1525650897.410587, type 4 (EV_MSC), code 4 (MSC_SCAN), value 29 Event: time 1525650897.410587, type 1 (EV_KEY), code 41 (KEY_GRAVE), value 1 Event: time 1525650897.410587, -------------- SYN_REPORT ------------ 'Event: time 1525650897.466550, type 4 (EV_MSC), code 4 (MSC_SCAN), value 29 Event: time 1525650897.466550, type 1 (EV_KEY), code 41 (KEY_GRAVE), value 0 Event: time 1525650897.466550, -------------- SYN_REPORT ------------ Event: time 1525650908.301683, type 4 (EV_MSC), code 4 (MSC_SCAN), value 29 Event: time 1525650908.301683, type 1 (EV_KEY), code 41 (KEY_GRAVE), value 1 Event: time 1525650908.301683, -------------- SYN_REPORT ------------ 'Event: time 1525650908.411541, type 4 (EV_MSC), code 4 (MSC_SCAN), value 29 Event: time 1525650908.411541, type 1 (EV_KEY), code 41 (KEY_GRAVE), value 0 Event: time 1525650908.411541, -------------- SYN_REPORT ------------

(the first SYN_REPORT is before I type either)

MOzSalles

Posted 2018-03-30T13:28:49.063

Reputation: 41

You may find this useful. It might be helpful, if you showed exactly how did you change the .map file and xorg layout file.

– jarno – 2019-09-02T14:49:11.773

Does this work for you?

– jarno – 2019-09-02T15:46:42.493

Answers

0

Use evtest to find out how the kernel sees them. If they have different scancodes, the kernel input layer can map them to different keycodes, for example using the udev hwdb.

dirkt

Posted 2018-03-30T13:28:49.063

Reputation: 11 627

evtest gave me the same information as xev. they seem to have the same scancode. is there anything else to be done? – MOzSalles – 2018-05-06T00:59:33.857

Please edit question with the evtest output for both keys, and indicate in which order you pressed them. – dirkt – 2018-05-06T04:27:42.833