Comment 8 for bug 390552

Revision history for this message
ekilfoil (ekilfoil) wrote : Re: [Bug 390552] Re: Add a key-release signal in addition to key-press

I think this may be what you're looking for:

http://msdn.microsoft.com/en-us/library/ms644990(VS.85).aspx
and some more info here:

http://www.codeproject.com/KB/cs/globalhook.aspx

You have to be careful with XGrabKey as well. XGrabKey will steal focus and
you also lose the ability to *not* steal the key from the XEvent queue. In
fact, I think this is harder to do in X than it is in Windows. I ended up
having to code a GTK timeout to poll the state of the keyboard every 250msec
in order to implement this, and I think that's a horrible, horrible
solution.

The EVIE library may have a solution for it in X though. But I know in
Windows that this can be done, because I've seen apps that do this. They're
all just closed source.

-eric

On Mon, Sep 14, 2009 at 1:06 PM, Mikkel Kamstrup Erlandsen <
<email address hidden>> wrote:

> The Win32 docs for KEY{UP,DOWN} specifically say that they are added to
> the message queue of the window with the focus. We an equivalent of
> XGrabKey: http://tronche.com/gui/x/xlib/input/XGrabKey.html
>
> --
> Add a key-release signal in addition to key-press
> https://bugs.launchpad.net/bugs/390552
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in Gtk Hotkey Library: Confirmed
> Status in GtkHotkey 0.3 series: New
>
> Bug description:
> When the hotkey is pressed, an event is sent as expected, however, there is
> no way to track a release event. The keypress release seems to happen
> instantly.
>
> We're trying to implement a GPL version of voice chat software. The
> software uses a keypress to turn on the mic and send sound.
>
> Instead of an "activated" event, I would expect a "pressed" and "released"
> event just like a GTK button.
>