Re: Pressing a button while enter/space is pressed

Federico Mena Quintero <federico ximian com> writes:
> I wanted to hack GtkButton so that it would show itself as pressed
> while the spacebar or Enter is being held down (and you could cancel
> the press with Escape).
> However, I have no clue of how to do that because if you hold down
> those keys, you'll get a multitude of KeyPress and KeyRelease events.
> How do I tell X to give me a single KeyRelease when the key is
> actually released?

HEAD GDK implements this using XkbSetDetectableAutoRepeat() if
available and emulates by discarding key events with the same
timestamp/keycode/state otherwise.

There's also button animation stuff but it just animates with a
timeout right now, it doesn't allow cancellation. (This might be
tricky because the key press is going via binding set, activation
isn't done in the button key press handler.)


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