Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The correct hwdb mappings from key 'a' to key 'b' and vice-versa for an USB keyboard are:

keyboard:usb:v*p*
 KEYBOARD_KEY_70004=b
 KEYBOARD_KEY_70005=a

The scan codes for an USB keyboard are *NOT what the showkey -s command reveals. Instead, they can be found from the evtest command (see the *'value' field):

Event: time 1399420905.069693, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70004
Event: time 1399420905.069693, type 1 (EV_KEY), code 30 (KEY_A), value 1
Event: time 1399420905.069693, -------------- SYN_REPORT ------------
aEvent: time 1399420905.181691, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70004
Event: time 1399420905.181691, type 1 (EV_KEY), code 30 (KEY_A), value 0
Event: time 1399420905.181691, -------------- SYN_REPORT ------------
Event: time 1399420910.525751, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70005
Event: time 1399420910.525751, type 1 (EV_KEY), code 48 (KEY_B), value 1
Event: time 1399420910.525751, -------------- SYN_REPORT ------------
bEvent: time 1399420910.605743, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70005
Event: time 1399420910.605743, type 1 (EV_KEY), code 48 (KEY_B), value 0
Event: time 1399420910.605743, -------------- SYN_REPORT ------------

The correct hwdb mappings from key 'a' to key 'b' and vice-versa for an USB keyboard are:

keyboard:usb:v*p*
 KEYBOARD_KEY_70004=b
 KEYBOARD_KEY_70005=a

The scan codes for an USB keyboard are *NOT*NOT* what the showkey -s command reveals. Instead, they can be found from the evtest command (see the *'value''value' field):

Event: time 1399420905.069693, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70004
Event: time 1399420905.069693, type 1 (EV_KEY), code 30 (KEY_A), value 1
Event: time 1399420905.069693, -------------- SYN_REPORT ------------
aEvent: time 1399420905.181691, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70004
Event: time 1399420905.181691, type 1 (EV_KEY), code 30 (KEY_A), value 0
Event: time 1399420905.181691, -------------- SYN_REPORT ------------
Event: time 1399420910.525751, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70005
Event: time 1399420910.525751, type 1 (EV_KEY), code 48 (KEY_B), value 1
Event: time 1399420910.525751, -------------- SYN_REPORT ------------
bEvent: time 1399420910.605743, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70005
Event: time 1399420910.605743, type 1 (EV_KEY), code 48 (KEY_B), value 0
Event: time 1399420910.605743, -------------- SYN_REPORT ------------