You are not logged in.

#1 2015-10-13 18:59:00

PhotonX
Member
From: Munich
Registered: 2008-08-10
Posts: 606

[Solved] Assign keycodes to scancodes - are there not used keycodes?

Hello community,

the title is quite poorly formulated, let me try to explain. I'm using a Thinkpad X200T which has some extra keys on its screen. These keys are not recognized by xev, that is, they generate no keycodes. However, following the steps in https://wiki.archlinux.org/index.php/Ma … o_keycodes I was able to find out the scancodes and assign keycodes to them. My aim is to assign some specific actions to these keys, i.e. run some script or a shortkey. I would use xbindkeys and assign some commands to the keycodes.

So far everything works fine. However, I'm a bit puzzled which keycodes to use. The keycodes are supposed to be merely a bridge between the scancodes and xbindkeys. That is, I probably shouldn't use the keycode of, say, the A key - otherwise xbindkeys will steal the keypress events and I won't be able to use the A key any more. This, however, applies to all of the keys on the keyboard, all of them are potentially useful. smile Therefore, my question is: Which keycodes to use such that no keys are spoiled? Or is there another way to map scancodes to actions directly?

Thanks in advance,
Photon

Last edited by PhotonX (2015-10-14 21:09:29)


Desktop: http://www.sysprofile.de/id15562, Arch Linux    |    Notebook: Thinkpad L13 Yoga Gen2, Manjaro

The very worst thing you can do with free software is to download it, see that it doesn't work for some reason, leave it, and tell your friends that it doesn't work.  -  Tuomas Lukka

Offline

#2 2015-10-14 20:53:58

zamzing
Member
From: Washington, DC
Registered: 2015-10-08
Posts: 24

Re: [Solved] Assign keycodes to scancodes - are there not used keycodes?

I found the following command helpful in finding unused keycodes:

$ xmodmap -pke

See this article and xmodmap for more details.

Offline

#3 2015-10-14 21:09:11

PhotonX
Member
From: Munich
Registered: 2008-08-10
Posts: 606

Re: [Solved] Assign keycodes to scancodes - are there not used keycodes?

Big thanks, this solves the problem!


Desktop: http://www.sysprofile.de/id15562, Arch Linux    |    Notebook: Thinkpad L13 Yoga Gen2, Manjaro

The very worst thing you can do with free software is to download it, see that it doesn't work for some reason, leave it, and tell your friends that it doesn't work.  -  Tuomas Lukka

Offline

#4 2015-10-14 21:27:26

progandy
Member
Registered: 2012-05-17
Posts: 5,318

Re: [Solved] Assign keycodes to scancodes - are there not used keycodes?

By the way, you might want to use the symbols XF86RotateWindows for the rotation and XF86Tools for the toolbox button, they are probably assigned to a keycode already.

Last edited by progandy (2015-10-14 21:29:36)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#5 2015-10-15 10:12:50

PhotonX
Member
From: Munich
Registered: 2008-08-10
Posts: 606

Re: [Solved] Assign keycodes to scancodes - are there not used keycodes?

Thanks, that's a good idea!


Desktop: http://www.sysprofile.de/id15562, Arch Linux    |    Notebook: Thinkpad L13 Yoga Gen2, Manjaro

The very worst thing you can do with free software is to download it, see that it doesn't work for some reason, leave it, and tell your friends that it doesn't work.  -  Tuomas Lukka

Offline

Board footer

Powered by FluxBB