3

I am trying to find what is being called when I press a keyboard shortcut. For example, if I hit Ctrl + Alt + L I block the screen, or when I hit the "mute" key in my keyboard I mute the sound. I can't find where those bindings are stored.

I have found the list of bindings in /usr/share/gnome-control-center/keybindings, but I don't see there the effect of the key, just that it is a shortcut. I am not looking for the window where the shortcuts are listed (1) but I want what the shortcuts are calling.

For example, if I create a new shortcut, which executes a shell script, it's easy to see what it is calling, just clicking on the name (in the said window 1), but if it's a default shortcut, clicking on the name disables the shortcut, so I want to know what the shortcut executes when it's activated.

I'm using Gnome Shell (not Unity) in Ubuntu 12.04

4 Answers 4

1

As stated in this Reddit thread, keyboard shortcuts are stored in dconf, which is binary file, not a text file. I think that's why you cannot directly find what is called when you press a keyboard shortcut. However, you can find this information if you first dump all the keybinding settings in dconf to a text file, and then go and peruse it :). This also explained in the cited Reddit thread. The command to do that is:

$ dconf dump / > mysettings.conf

I used this approach to find out the "text definition" of some shortcuts I defined to switch among workspaces, in the GUI keyboard shortcuts settings (I'm using Ubuntu 22.04).

You could define shortcuts from the command line as well, as shown here, for example.

Last, command xmodmap -pke I got from here tells you how GNOME calls, or labels, all the shifted characters in the keyboard, such as # (Shift+3), or % (Shift+5), in an English keyboard layout. This comes in handy if you use the command line to define shortcuts!

0

If you have a windows key on your computer hold that down for a couple seconds. hope that helps :P

7
  • It doesn't work. At least not in gnome-shell.
    – vguzmanp
    Dec 1, 2012 at 20:14
  • could you tell me what version of Ubuntu you are using? Dec 1, 2012 at 20:41
  • Ubuntu 12.04, it is written in the question
    – vguzmanp
    Dec 1, 2012 at 20:42
  • Not exactly what I am looking for. That link is also a list of shortcuts, but it doesn't say what is being called.
    – vguzmanp
    Dec 1, 2012 at 20:49
0

Search for Keyboard Shortcuts in unity. Should help.

6
  • I'm not using Unity, I use Gnome-shell
    – vguzmanp
    Dec 1, 2012 at 20:28
  • Isn't there Keyboard Shortcuts in it too? I'm sorry, I dont use it :/ Keyboard Shortcuts is usually found in Settings window. Dec 1, 2012 at 20:30
  • this is how it looks like. Dec 1, 2012 at 20:31
  • yes, there's a window exactly like that, but that only tells me what effect the shortcut has, but I want to find what is being called, if it is a script, or something
    – vguzmanp
    Dec 1, 2012 at 20:33
  • Ahh. That was the /usr/share... you were talking about? Well. I dont know anymore. Dec 1, 2012 at 20:40
0

I don't know if this gives you everything you want to know, but if you run this command:

xmodmap -pke | less

You will get output on what every key on the keyboard does. It's a little cryptic because you don't get names just keycodes.

Excerpt from my machine:

keycode  13 = 4 dollar 4 dollar
keycode  14 = 5 percent 5 percent
keycode  15 = 6 asciicircum 6 asciicircum
keycode  16 = 7 ampersand 7 ampersand
keycode  17 = 8 asterisk 8 asterisk
keycode  18 = 9 parenleft 9 parenleft
keycode  19 = 0 parenright 0 parenright
keycode  20 = minus underscore minus underscore
keycode  21 = equal plus equal plus
keycode  22 = BackSpace BackSpace BackSpace BackSpace
keycode  23 = Tab ISO_Left_Tab Tab ISO_Left_Tab
keycode  24 = q Q q Q
keycode  25 = w W w W
keycode  26 = e E e E
keycode  27 = r R r R
keycode  28 = t T t T
keycode  29 = y Y y Y
keycode  30 = u U u U

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .