[PyQt] Catching key events

Frédéric frederic.mantegazza at gbiloba.org
Sun Jan 18 23:14:37 GMT 2009


On samedi 17 janvier 2009, Frédéric wrote:

> I still have an issue: when I hold down a key, once the repeat starts, I
> receive both KeyPressed and KeyReleased events. This is a different
> behaviour as PyGTK, where I only received the key-pressed-event while
> holding it down, and the key-release-event when I release the key.
>
> Is there a way to do this in PyQt? I want to start the motor head when I
> press the key, and stop it when I release the key. Now, it does not
> work, as the motor is started/stopped too quickly (which is not very
> good)...
>
> I forgot to ask: once I have checked all the key events, in
> keyPressedEvent, how do I let propagate the event I don't want to handle?

No idea?

-- 
    Frédéric

    http://www.gbiloba.org



More information about the PyQt mailing list