[Qt-interest] trapping SPACE key in a widget without having focus?
Paul Miller
paul at fxtech.com
Thu Sep 23 16:53:11 CEST 2010
On 9/23/2010 9:19 AM, Ian Clark wrote:
> On 22 September 2010 21:50, Paul Miller<paul at fxtech.com> wrote:
>> I want one of my widgets to see all SPACE key events coming in, and then
>> decide whether to eat it, without having explicit focus. Is this
>> possible, with an event handler or something? It needs to work even when
>> a text field might have focus.
>
> I think you need to install an event filter, probably on the window
> containing the widget you're dealing with.
>
> http://doc.trolltech.com/4.6.2/qobject.html#installEventFilter
>
> Has an example that deals with intercepting keypresses.
Yes, all key-presses seem to come in EXCEPT Space.
More information about the Qt-interest-old
mailing list