Qt-interest Archive, March 2007
Key events
Message 1 in thread
I'm trying to capture some key events and convert them to other key
events. I'm doing this with an event filter on QApplication and I'm
trying to use the spontaneous() method on the event to distinguish
between the key events from the user (that I want to convert) and the
key events that I've converted (which the event filter should ignore).
What I expected was that I would get a KeyPress event with the
spontaneous flag set when the user presses a key and then a KeyRelease
event also with the spontaneous flag set when the key is released. What
I'm actually getting is a KeyPress that isn't set to spontaneous and
then a KeyRelease which is.
Is there a reason for this? I thought the spontaneous flag was supposed
to be set for key presses and releases and other events from outside of
the application. I'm using Qt 4.2.2 on a Ubuntu 6.06 Linux distribution.
--
[ signature omitted ]