Re: Key Release Events

Great! This is mostly for personal use, so I don't mind patching mutter to get it working.

Thanks for your help!

On 04/23/2015 07:57 PM, Jasper St. Pierre wrote:
This behavior is actually super tricky to get right and is implemented
with a complex state machine in mutter.

You cannot implement something similar from a GNOME Shell Extension. Sorry.

On Thu, Apr 23, 2015 at 7:52 PM, Vjekoslav Brajkovic
<vjeko brajkovic org> wrote:
Thanks Jasper!

Let me try to narrow down my question. Gnome appears to be doing the thing I
want, I just cannot figure out how it's doing it.

1) I press and hold the <Super> key.
2) The current active window does retains focus. If I type anything while
I'm holding the key, that window will receive keyboard input.
3) Once I release the <Super> key, overview actor will become active.

I would like to get the same functionality. I would like to get notified
when that key gets released the same way overview does. In order to get this
working do I have to change main.js?

On 04/23/2015 07:32 PM, Jasper St. Pierre wrote:
X11 has no such mechanism to give that to you. Key presses and
releases are sent directly to the application that has focus, not to
the window manager.

Main.wm.addKeybinding allows you to register a "grab", which is a way
of punching through this model, but unfortunately, grab semantics are
hard to make work for the release case. So we don't properly trigger
keybindings for key release.

On Thu, Apr 23, 2015 at 4:40 PM, Vjekoslav Brajkovic
<vjeko brajkovic org> wrote:

I am writing an extension and would like to get notified when a
key-*release*-event has occurred regardless of which actor has key focus
without changing it.

  From what I understand, the indented way of doing this would be by
registering a callback with Main.wm.addKeybinding() and specifying a
KeyHandlerFunc. The problem is that key release/press information seems
be missing when the handler gets invoked -- the  ClutterKeyEvent
is missing and instead of it I get Meta.KeyBinding.

I have also tried doing global.stage.connect('key-release-event', ...),
the stage does not receive any signals unless I change the key focus to
actor like overview, which I assume propagates its signals.

Does anyone have any ideas or suggestions?


gnome-shell-list mailing list
gnome-shell-list gnome org

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]