Home > Linux, Operating Systems, Software Development > Kubuntu 11.10: Mapping the Windows Key to Activate KMenu

Kubuntu 11.10: Mapping the Windows Key to Activate KMenu


This post is an explanation of how to map the Windows key on a Dell Studio 17 running Kubuntu 11.10 to open the KMenu. If you, or your programs, rely on the Windows key as a Meta key for certain functionality this will break that. This is your only warning.

This is taken from the Mepis docs that can be found at http://www.mepis.org/docs/en/index.php?title=Extra_keys. I wandered around the world for a long time before I stumbled onto this wiki and it laid everything out step-by-step. I am simply listing the same steps from the Mepis Extra Keys documentation modified for Kubuntu running on my Studio 17 notebook.

  1. Open a Konsole window
  2. Find the key to which Super_L (the Windows key comes up as Super_L) is mapped by running xev (it will open a small window that waits for your keyboard input and displays it in the console window where xev was started. Closing the window will cause xev to terminate)
     > xev | grep Super_L
     state 0x0, keycode 133 (keysym 0xffeb, Super_L), same_screen YES,
     state 0x40, keycode 133 (keysym 0xffeb, Super_L), same_screen YES,
    

    The keycode above came from my keyboard. Please run xev to determine what your keycode is.

  3. Create a file under ~/.kde/Autostart to remap the above discovered keycode to F13. I called my file win-key.sh as per the doc at Mepis (also Mepis mentioned mapping the keycode to the string Menu, but that did not work for me).
    #!/bin/bash
    xmodmap -e 'keycode 133 = F13'
    
  4. Make the script you created in Step 3 executable:
    > chmod +x ~/.kde/Autostart/win-key.sh
    
  5. Execute the script manually (it will be executed every time you restart)
    > ~/.kde/Autostart/win-key.sh
    
  6. Confirm the keycode has been mapped to F13
     > xev | grep F13
     state 0x0, keycode 133 (keysym 0xffca, F13), same_screen YES,
     state 0x40, keycode 133 (keysym 0xffca, F13), same_screen YES,
    
  7. KMenu –> Search: Global Keyboard Shortcuts –> KDE Component: Plasma Desktop Shell –> Activate Application Launcher Widget –> Custom (Click None)
    • Press the Windows Key and None should change to F13
  8. Click OK.

The Windows key should now activate the KMenu. Remember, if you have programs using the Windows key as the Meta key then your programs will now be broken (I lied when I said I would only warn you once).

I was a man on a mission today. The cat was grateful for the air.

About these ads
  1. johnrobert
    January 20, 2012 at 6:05 pm

    You have saved me possible hours of search and frustration. I thank you, and my Dell Studio 17 running Kubuntu 11.10 thanks you as well.

    • cvalcarcel
      January 21, 2012 at 11:43 pm

      I live to serve…and to keep track of things I do on my Linux box that I know I will forget by the next fresh install…

  2. Darkocan
    January 21, 2012 at 10:11 am

    GRANDISSIMO PORCODDIOOOOOOOOOOOO

    • cvalcarcel
      January 21, 2012 at 11:43 pm

      (Jeez, I hope that was a compliment…) ;)

  3. Abhijeet
    June 3, 2012 at 10:28 am

    That was one thing i missed so much from unity. Back to KDE forever. I wuv you!

  4. Murz
    August 23, 2012 at 1:31 am

    Other key combinations will work (Win+D, Win+R) normally after this fix, but KMenu will open/close on each keypress. Is exist any fix for this?

  5. istok
    November 18, 2012 at 8:52 pm

    Good tip, but there’s an even simpler way. I already have .Xmodmap file in my home (to remap end and delete keys on my Thinkpad). I just added keycode 133 = F13 to that file, logged in again, and it works.

    • January 9, 2013 at 12:25 am

      istok, thanks, this way works, but it broke other win+key combinations, for example – win+R, win+D and other, so we can use only single Win keypres or Win with other keys, but not together :(

  6. January 9, 2013 at 3:52 am

    I have found the very good solution for this problem, it is described on page http://hanschen.org/2012/10/17/open-application-launcher-with-super-key/

  7. November 4, 2013 at 5:45 pm

    Sir, thank you so much.

  8. matteuz
    November 12, 2013 at 8:33 am

    This remains best solution on KDE, greet tip cvalcarcel!!

    and… great comment by Darkocan, you are the numberone!

  1. August 27, 2012 at 2:50 am

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 3,187 other followers

%d bloggers like this: