Undefining hotkeys / shortcuts

General support questions including new installations
Post Reply
petermallan
Posts: 2
Joined: 2014/09/07 21:03:08

Undefining hotkeys / shortcuts

Post by petermallan » 2014/09/07 21:28:02

I am running CentOS 5.10 on a standard PC, but with a DEC LK461 keyboard. This keyboard has more function keys than a standard PC keyboard. The keys labelled, F13, F14, Help, Do and F17 are not recognised by default, but I have got CentOS to recognised them by using the setkeycode command. The specific command that I use for the Do key is

setkeycodes e040 116

This works fine, except that when I run the standard gnome desktop and press the Do key, a message box appears saying
"Are you sure you want to log out?", giving me the option to log out, shut down, or restart the computer. I want the key to have a completely different effect and not to make this dialogue box appear at all.

So my question is, how can I stop the dialogue box appearing when I press the Do key?

I have tried changing the shortcut that is associated with the Log Out action in the Keyboard Shortcuts System -> Preferences box, but this has no effect.

I feel it should be simple to disconnect a key from an action like this, but I am completely failing to find out how. All advice greatly appreciated.

Peter Allan

petermallan
Posts: 2
Joined: 2014/09/07 21:03:08

Re: Undefining hotkeys / shortcuts

Post by petermallan » 2014/12/28 15:34:26

After trying several alternatives, I can finally answer my own question, or to be more accurate, I can stop it doing what was annoying me.

It seems that keycode 116 is defined in the kernel as the shutdown key. (See contents of /usr/include/linux/input.h). Hence it should not be too surprising (with hindsight) that the key has an effect such as trying to log you out of the gnome desktop.

By defining the Do key to be something else (I chose 186 instead of 116 since 186 is the key for F16 in /usr/include/linux/input.h, but any unused keycode should be ok), then the message box asking if I want to log out no longer appears. I can then define the mapping for the Do key in the gnome desktop in the file /etc/X11/Xmodmap

If you try doing this, note that the X keycode is not the same as the console keycode, so the line I have in my Xmodmap file to define the Do key in gnome is

keycode 93 = Menu

To discover the X keycode for a key that you wish to redefine, run xev and look for the keycode in the output.

Peter Allan

Post Reply