Mailinglist Archive: opensuse (1264 mails)

< Previous Next >
Re: [opensuse] Mapping and re-mapping Keyboard Keys
  • From: Knurpht - Gertjan Lettink <knurpht@xxxxxxxxxxxx>
  • Date: Tue, 27 Jun 2017 00:06:17 +0200
  • Message-id: <1591431.WJc5C7pdij@knurphtlaptop>
Op maandag 26 juni 2017 23:52:31 CEST schreef Aaron Digulla:
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

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.

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.

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
this.

Better place: /etc/init.d/after.local

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.

Regards,


--
Gertjan Lettink, a.k.a. Knurpht

openSUSE Board Member
openSUSE Forums Team

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

< Previous Next >