Mailinglist Archive: opensuse (1264 mails)

< Previous Next >
Re: [opensuse] Mapping and re-mapping Keyboard Keys
On 26/06/17 22:52, Aaron Digulla wrote:
Am 26.06.2017 um 22:44 schrieb Paul Groves:
[23566.462308] atkbd serio0: Unknown key released (translated set 2,
code 0xa3 on isa0060/serio0).
[23566.462311] atkbd serio0: Use 'setkeycodes e023 <keycode>' to make
it known.

This gives me, on the first line 0xa3 and on the second line e023 What
are these two codes? Are they the scancode or keycode?
Well, read the message: "Use setkeycodes e023 <keycode>".
The command

what about the 0xa3? What is that for?

man setkeycodes

(run it in a terminal or google it) explains in detail how setkeycodes
works. "dumpkeys" will tell you which keycodes the kernel understands.

Note: I tried to run those commands on the Desktop and they fail there
with "Couldn't get a file descriptor referring to the console". They
probably only work on a text-mode console. Try Ctrl+Alt-F1 to switch to
one. Ctrl+Alt+F6 or F7 to go back to the Desktop. If you don't know
about this, write the key combinations down before you try them or be
ready to reboot your system the hard way.
Yes it only works in a tty not in a desktop terminal
As for the keys that do work I have found that if I go to a terminal
(ctrl + alt + f2) and press one of the keys that are already mapped to
something (in this case the internet hotkey) then run showkey -k I get
this output:

0xe0 0x20
0xe0 0xa0

I am assuming I can ignore the 0xe0?So this leaves me with 0x20 and
0xa0 which I assume are key press and key release. Is this correct?
Are they the scancode or keycode?
If you ignore 0xe0, then the code means "Space" and "Non-breaking
space". Let's hope you don't have to ignore them (or you won't be able
to map the key without losing your space bar as well).

Those codes look very similar the the first agument for setkeycodes, so
my guess is they are scancodes.
So does this therefore make the scancode e020 for key press and e0a0 for key release?
I have written these codes down for all my hotkeys. How can I now
change their mappings?
Find out the key codes and run a script at boot time which contains a
series of calls to setkeycodes. /etc/init.d/rc.local is a good place for
How do I find out the keycodes from my system?

Also can I define my own keycodes for Hotkeys 1 through 4? This would be ideal because then I can then go into the Keyboard Shortcuts in system settings and choose there functions in the GUI (which is what these keys are intended for).
Preferable after the key table has been loaded - that will overwrite
any changes you make. Good to know when you make a mistake.
I also suggest you have a second computer in the same network so you can
ssh into the box when you messed up the keyboard so badly that you can't
do anything anymore.

Note: Running the command from an autostart script for your Desktop or
.bashrc/.profile won't work.


To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >