Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I would like to set a shortcut for the Run-Command in Kubuntu 12.04, where the shortcut key would be the Win key (aka Meta).

The Global Keyboard Shortcut settings however does not allow me to use the Meta key alone, but rather in combination with some other key.

As a keyboard-power-user, I find this frustrating: I want to open-search as fast as possible and the Win key is a perfect candidate, which I used to use with Gnome or XFCE.

Is there a possibility to override this rule preventing me from using the Meta key alone as a shortcut key?

share|improve this question
    
I think this has been asked already. And the only solution they found was to make the Meta key something different, which would make it impossible to use in key combinations. –  Oleh Prypin Aug 18 '12 at 17:38
    
Let me see if I can find that question you mentioned. PS: I wouldn't mind being able to set the shorcut on the Menu key as an alternative. –  Benjamin Aug 18 '12 at 18:02

1 Answer 1

up vote 3 down vote accepted

Meta key can't be used as a shortcut alone, because Qt, and therefore KDE, uses it only as a modifier.

But you can set it to some two-key shortcut that you like. Go to Global Keyboard Shortcuts – KDE Control Module, look for something like KRunner or Command Run Interface in KDE component and change the Alt+F2 keyboard shortcut to something like Meta+Space.

And if you really want to have it mapped to just the Meta key, I found a solution in this article. It suggests to remap the Meta key to some other key like F13.
Just add the line xmodmap -e 'keycode 133 = F13' to your autostart script. Then you should run the same line in a terminal or just relogin for it to take effect.
If you want to do it with different keys, use xev | grep keycode, press the keys and look at the output.

Then change the shortcut as usual, and when you press the Meta key, it will show up as F13. Note that F13 won't work as a modifier key, so you can't make key combinations with it, and also some applications might need to use the Meta key itself, so that won't work too.

share|improve this answer
    
Thanks. The first half of the answer does not help because I am looking for a shorcut to Run-Command, not to Kickoff-Menu and with the Meta key only, not a combo. The second half is really interesting however and I am asking myself whether I could map the Meta-key to something more useful than F13, like the Menu-key or inversely, map the Menu to F13, so I could use the Menu-key to launch the Run-Command. –  Benjamin Aug 18 '12 at 19:06
    
@Benjamin I've updated the answer. I don't know what your Menu key is, but it might just work without any tricks (like in the first part of the answer). –  Oleh Prypin Aug 18 '12 at 19:27
    
OK I confirm the second part is the solution. I have mapped the Menu-key (Menu-key is between Right-Alt and Right-Ctrl) to behave as F13 and use it to launch Run-Command (it seemed wiser than re-mapping the Win-key, because much more shorcuts use it). I suggest you copy the answer from the link your provided over here, in case it ever becomes a dead link and it might get you extra up-votes too. –  Benjamin Aug 18 '12 at 19:32
1  
@Benjamin That article is too verbose; I made a summary of the most important things there. –  Oleh Prypin Aug 18 '12 at 19:43
    
Where is the auto-start script? I added a .sh file to the ~/.Kde/Autostart folder as per the article. –  Benjamin Aug 19 '12 at 6:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.