How to use keyboard events ?

Peyre peyre at sans-logis.u-strasbg.fr
Tue Nov 23 13:32:51 GMT 1999


Hi,

I've started to implement an application in which I need
to operate some actions when the ALT, SHIFT or CTRL key
is pressed or released while I press or release a mouse button
in the app view. I'm not sure that the solution I've chosen is the
best one but I've made the app view inherits QGLWidget.

I overloaded the keyPressEvent and the keyReleaseEvent methods
but this did not seem to be enough since these methods were never
called. Then, I've enabled the keyboard focus for the view widget
(in fact, I've called setFocusPolicy(StrongFocus)).
This way, the key event methods was called, as waited, but since,
the view flickers each time the mouse cursor get in or out the view
and further more the application runs in a noticeably slower way.

Could anyone bring me some help ?
Thank u very much for your answers.

--
Hubert Peyré
Pole API - Bd Sébastien Brant - 67400 Illkirch
Tel : +33 (0) 388 65 55 41
E-mail : peyre at dpt-info.u-strasbg.fr




More information about the KDevelop mailing list