Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

HUD should be activated via a single press of the ALT key #1

Closed
flexiondotorg opened this issue Jul 16, 2017 · 12 comments
Closed

HUD should be activated via a single press of the ALT key #1

flexiondotorg opened this issue Jul 16, 2017 · 12 comments

Comments

@flexiondotorg
Copy link
Member

This is MATE HUD, which provides a way to run menubar commands through rofi, much like the Unity 7 Heads-Up Display (HUD). It should feature in Ubuntu MATE 17.10 soon.

However, to activate it I'm using keybinder 3.0 and the Ctrl + Alt + Space binding. The Unity 7 HUD is activated via a single press of the Alt key, much like how Super key works. Would you be interested in take a look to see if MATE HUD can be update to support activation via release of the Alt key with no other keys having been pressed while Alt was depressed?

You can test on a VM running Ubuntu MATE 17.10 daily.

  • Install Ubuntu MATE 17.10 daily in a VM.
  • Add the Global Menu PPA and install mate-applet-appmenu
    • sudo apt-add-repository ppa:ubuntu-mate-deb/global-menu
    • sudo apt update
    • sudo apt install mate-hud mate-applet-appmenu
  • Reboot.

@vkareh Given you recent involvement I wondered if you might be able to take a look at this?

@flexiondotorg flexiondotorg changed the title HUD should be activated via a single press of the ALT jey HUD should be activated via a single press of the ALT key Jul 16, 2017
@vkareh
Copy link
Member

vkareh commented Jul 16, 2017

@flexiondotorg, most certainly - I'll take a look at this!

@flexiondotorg
Copy link
Member Author

So as discussed in Slack, just get Alt + Super working for now. It sounds like unpicking everything to get just Alt release working might be overly involved :-)

@vkareh
Copy link
Member

vkareh commented Jul 23, 2017

@flexiondotorg - I created #2 to address this issue.

It allows the user to use Alt_L to open the HUD, but it causes erratic behavior when also using <Alt> for window shortcuts. For the time being, I added a warning in the gsettings description and defaulted it to <Super>Alt_L as discussed. Therefore, I don't consider #2 as a fix for this.

I've traced the issue down to a section in the main event handler function of Marco, where the event window is not being detected properly for synthetic events coming from a different client, so Marco thinks it's a global shortcut, instead of a window shortcut. X wasn't really created with that use-case in mind, so the fix involves tricking the system into thinking that the event originated in a different window and that the previous grab never really happened. Compiz already does this, but the code is a huge ball of C++, so it's taking me a while to parse through all the cruft. I also suspect python-xlib is not entirely blameless, but I'd have to test the theory using a pure-C version of the global keybinder (i.e. brisk-menu).

As soon as I have a fix for Marco, I'll send it in and proceed to update a bunch of MATE programs that use global keybindings (mate-menu, brisk-menu, mate-hud). Eventually I'd like to update the keybinder library to support modifiers-as-triggers (which then means I'll have to update all those programs again, but I'll take it one step at a time until then).

Anyway, there you go 😛

@flexiondotorg
Copy link
Member Author

Closed via 55f4cf4

@RaitaroH
Copy link

RaitaroH commented Oct 15, 2018

@vkareh EDIT: You can ignore bellow 😅 . I realized that in dconf (first time using it), the Alt_L shortcut wasn't working because it MUST be <Alt>L instead. So I changed it to <Alt>space and now it works fine. No conflicts anymore with other things... I just didn't read the text haha

P.S. waterfox 56.2.3 doesn't work but hey, not a big problem.

A little background. I am on Kde Neon here, not mate... but hey! It works. I only needed to install mate-hud then track down a deb file for appmenu-gtk-module. Everything nice and all... also manually add a call to the py script to autostart, but no problems there.

@vkareh Ok... but let's say I DON'T want it to be JUST ALT. In my case I use alt for a lot of other shortcuts and that means I need to do alt + key*2 (the 2nd press of the key actually makes the shortcut behave). Even Alt+Tab doesn't quite work unless double keypress. Also Alt-L doesn't do anything for me. I tried to add exceptions in the py file but doesn't seem to do anything.
whitelist = ['Return', 'Up', 'Down', 'Left', 'Right', 'Home', 'D', 'X', 'Space'] I used Alt + arrow keys to move around my desktop, alt+x to kill window, alt+z for zoom in, etc etc.

Also I did modify dpi a bit, / 1.5 instead because it just looks better to me like that.

@vkareh
Copy link
Member

vkareh commented Oct 15, 2018

@RaitaroH - hah, good thing you figured that out! Also, to fix the need to use double-keys for any Alt+foo*2 you need mate-settings-daemon, which since you're not running MATE it would not be there... So yeah, unless you run the mate-settings-daemon inside KDE (probably not recommended), you'll need to map the shortcut to something other than just Alt_L

@RaitaroH
Copy link

RaitaroH commented Oct 15, 2018

@vkareh No... I think I didn't express myself well.

  • if I have default for mate-hud Alt will be the shortcut key, where as Alt_L does not work. This will make any Alt+key shortcut require a double press (while alt is pressed so basically double the key)
  • if I have <Alt>L NOW the shortcut is actually respected and double presses are not required anymore. Interesting huh?

On another note, mate-hud crashes (process still running) from time to time... this IS REALLY BAD because the Alt key is triggered and makes any keyboard input besides tty switching useless...). I will try to capture the output of if and open a separate issue... maybe (might just be a kwin thing)

@vkareh
Copy link
Member

vkareh commented Oct 15, 2018

huh, interesting... Alt_L is really the Left Alt, whereas <Alt>L is Alt with the L key pressed... so by having Alt_L you're saying that you can toggle the HUD by just tapping Alt? If so, that's the default behavior.

Since X11 does not accept modifier keys as shortcuts (Alt is a modifier key) it has very strange behavior (like needing double-key presses: Alt+key+key). We therefore have those whitelisted keys.

However, I have a feeling that Alt-based keybindings break without mate-settings-daemon in place, which allows it to work together with other MATE keybindings (those in the whitelist, really). Which seems to be your experience: mate-hud is eating up the Alt key and not replaying it forward to other keygrab listeners...

@RaitaroH
Copy link

@vkareh I see. I made a special shortcut that hopefully will kill mate-hud in case it crashes again. I mapped mate-hud to alt-space to avoid conflicts so hopefully that will be nice now.

@vkareh
Copy link
Member

vkareh commented Oct 15, 2018

do let me know if it keeps crashing, especially if you can see any errors in your logs! we've discussed being able to use mate-hud in other desktop environments, so this could be useful :)

@RaitaroH
Copy link

python3 /usr/lib/mate-hud/mate-hud 2>&1 | tee -a ~/Desktop/mate-hud.log On it 👍

@RaitaroH
Copy link

Oh and... the autostart does not work on it's own. I needed to add it manually.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants