Xfce Forum

Sub domains
 

You are not logged in.

#1 2020-02-04 07:31:30

emil2007
Member
Registered: 2017-03-29
Posts: 11

Problem assigning meta key

I have assigned the meta key to launch the whisker menu and also assigned the combination meta+spacebar to change keyboard layout. But pressing meta+spacebar is launching the whisker menu, also and switching between keyboard layouts is not working very well. Why is that?

Offline

#2 2020-02-04 08:55:52

denyer
Member
From: UK
Registered: 2018-10-20
Posts: 25
Website

Re: Problem assigning meta key

The Windows keys are treated as modifiers (like Shift, Ctrl, etc) rather than producing a keypress.

You can install xcape (from the Ubuntu repositories if you're using Xubuntu or similar) and more info here --

https://github.com/janekfleper/xcape

When I was running Xfce I used this in a startup script:

xcape -e 'Super_L=Control_L|Escape;Super_R=Control_L|Escape'

(That equates to either Windows key sending the default Whisker menu shortcut of Ctrl+Escape).

Last edited by denyer (2020-02-04 09:01:34)

Offline

#3 2020-02-04 11:36:43

emil2007
Member
Registered: 2017-03-29
Posts: 11

Re: Problem assigning meta key

I am using debian and i installed xcape, but what script to use to make meta key open whisker menu and meta+space to switch keyboard layouts?

Also, is there a way to make meta key to open whisker menu on button release, not on button pressing?

Offline

#4 2020-02-04 17:01:42

alcornoqui
Member
Registered: 2014-07-28
Posts: 579

Re: Problem assigning meta key

1. Go to Settings > Keyboard > Application Shortcuts, and add or modify the shortcut to xfce4-popup-whiskermenu (don't keep it as "Super", make it a combo: in my example it's Alt+F1). Test the shortcut.

2. If it works, test the xcape command with the new shortcut (in a terminal or with any application launcher):

xcape -e 'Super_L=Alt_L|F1'

Substitute Alt+F1 for the shortcut you set in step 1, but with that syntax. The "Super" (or "Meta") key should open the menu on release

3. Go to Settings > Sesion and Startup > Application Autostart tab > Add button and add a startup script:

Name: Xcape
Comment: Converts Alt+F1 in Super key
Command: xcape -e 'Super_L=Alt_L|F1'

Again, substitute Alt+F1 for your shortcut.

4. After that, you can set any desired shortcuts with the Super key, like Super+Space, they won't interfere with the menu.

Last edited by alcornoqui (2020-02-04 17:03:04)

Offline

#5 2020-02-04 19:28:27

denyer
Member
From: UK
Registered: 2018-10-20
Posts: 25
Website

Re: Problem assigning meta key

emil2007 wrote:

is there a way to make meta key to open whisker menu on button release, not on button pressing?

That's the xcape behaviour so it should suit your usage case;

xcape allows you to use a modifier key as another key when pressed and released on its own. Note that it is slightly slower than pressing the original key, because the pressed event does not occur until the key is released. The default behaviour is to generate the Escape key when Left Control is pressed and released on its own. (If you don't understand why anybody would want this, I'm guessing that Vim is not your favourite text editor wink

Offline

#6 2020-02-04 22:53:42

emil2007
Member
Registered: 2017-03-29
Posts: 11

Re: Problem assigning meta key

alcornoqui wrote:

1. Go to Settings > Keyboard > Application Shortcuts, and add or modify the shortcut to xfce4-popup-whiskermenu (don't keep it as "Super", make it a combo: in my example it's Alt+F1). Test the shortcut.

2. If it works, test the xcape command with the new shortcut (in a terminal or with any application launcher):

xcape -e 'Super_L=Alt_L|F1'

Substitute Alt+F1 for the shortcut you set in step 1, but with that syntax. The "Super" (or "Meta") key should open the menu on release

3. Go to Settings > Sesion and Startup > Application Autostart tab > Add button and add a startup script:

Name: Xcape
Comment: Converts Alt+F1 in Super key
Command: xcape -e 'Super_L=Alt_L|F1'

Again, substitute Alt+F1 for your shortcut.

4. After that, you can set any desired shortcuts with the Super key, like Super+Space, they won't interfere with the menu.

Thanks, i followed the instruction and it worked. But i have other problem. I tried to assign the shortcut meta+space to show the desktop but i am unable to, and it shows 'ISO Next Group' which seems to be the spacebar: 

  g1Xf8Eil.png

Last edited by emil2007 (2020-02-04 23:00:41)

Offline

#7 2020-02-05 00:37:27

alcornoqui
Member
Registered: 2014-07-28
Posts: 579

Re: Problem assigning meta key

I had never seen that. I found a reference here, but the advice is raw and there's no follow-up:

> Set your language and keyboard properly. Don’t forget to press the “apply” button on Manjaro Settings Manager. Probably need a reboot for effect.

What's the output of localectl?

Offline

#8 2020-02-05 08:21:06

emil2007
Member
Registered: 2017-03-29
Posts: 11

Re: Problem assigning meta key

alcornoqui wrote:

I had never seen that. I found a reference here, but the advice is raw and there's no follow-up:

> Set your language and keyboard properly. Don’t forget to press the “apply” button on Manjaro Settings Manager. Probably need a reboot for effect.

What's the output of localectl?

I am using debian xfce and i don't have localctl, and it is not in the debian repository.
I am trying to use xcape to assign meta+space for showing the desktop. I setup Ctrl+Alt+D as shortcut for showing desktop, but i am not sure how to implement xcape remapping. I tried this: xcape -e 'Super_L|Space=Ctrl|Alt|D' but it is not working.

Offline

#9 2020-02-05 08:33:51

alcornoqui
Member
Registered: 2014-07-28
Posts: 579

Re: Problem assigning meta key

Check the spelling, it's localectl.

About Ctrl+Alt+D, you don't have to use xcape, that would be a totally normal shortcut: Window Manager > Keyboard > Shortcuts Show Desktop >>> Press Ctrl+Alt+D (I think it's the default shortcut).

Xcape is to convert a modifier (meta, control, shift) in a standalone key.

Offline

#10 2020-02-05 15:36:28

emil2007
Member
Registered: 2017-03-29
Posts: 11

Re: Problem assigning meta key

Yes, i misstyped the command. This is the output from localectl:   
   
   System Locale: LANG=en_US.UTF-8
                  LC_NUMERIC=bg_BG.UTF-8
                  LC_TIME=bg_BG.UTF-8
                  LC_MONETARY=bg_BG.UTF-8
                  LC_PAPER=bg_BG.UTF-8
                  LC_NAME=bg_BG.UTF-8
                  LC_ADDRESS=bg_BG.UTF-8
                  LC_TELEPHONE=bg_BG.UTF-8
                  LC_MEASUREMENT=bg_BG.UTF-8
                  LC_IDENTIFICATION=bg_BG.UTF-8
       VC Keymap: us
      X11 Layout: us
       X11 Model: pc105


I don't want to use ctrl+alt+d for 'show desktop'. I want to use meta+space but i am unable to set the shortuct.

Offline

#11 2020-02-05 15:59:54

alcornoqui
Member
Registered: 2014-07-28
Posts: 579

Re: Problem assigning meta key

Ok, let's recapitulate:

1. You want the Meta key to show the Whisker Menu
2. Then, you want Meta+Space to switch keyboard layouts
3. You want another shortcut to show desktop

For #1 you can use xcape as detailed upthread, once xcape is launched on startup with the correct command, you can use Meta both to open the menu and in combination with other keys, as normal customised keyboard combos.

If the problem with "ISO next group" continues, we can make other thread on that particular. If not, just assign any Meta+Key shortcut as usual and it will not interfere with the menu.

Offline

#12 2020-02-05 16:45:03

emil2007
Member
Registered: 2017-03-29
Posts: 11

Re: Problem assigning meta key

Sorry, i forget to say that i set the shortcut for changing the keyboard layout to ctrl+space from the ibus preferences.

Now i want to set meta+space to 'show desktop'.

Offline

Board footer

Powered by FluxBB