Keyboard key values and State
-
Hi All
I am using Qt in ubuntu linux.
In my program I want to know the status of currently pressed key,that is pressed state ,released state or continuous state
and pressed key value. How to achieve this?Thanks
-
for that, you'll have to either implement an "eventFilter":http://qt-project.org/doc/qt-4.8/qobject.html#eventFilter and "install it":http://qt-project.org/doc/qt-4.8/qobject.html#installEventFilter, or reimplement the "keyPressEvent":http://qt-project.org/doc/qt-4.8/qwidget.html#keyPressEvent on a QWidget.
The event you'll get in either of those two methods will hold the currently (or at the time of the event) pressed key.