View Full Version : How to identify Num pad keys

2nd September 2008, 14:19

I want to display the key press values in human readable format in QLineEdit.

like Ctrl + Alt + D, Alt + F .

I have written KeyPressEvent() and in which i am doing this stuff. its working.

But it doesnt work with Number pad.

So how i can identify the number pad keys in my keyPressEvent() so that i will be able to show it in my QLineEdit.

e.g Ctrl + Num 1 if NUM_LOCK is on
Ctrl + End if NUM_LOCK is off.

Thanks in advance.


2nd September 2008, 18:43
You have to use a Keyboard modifier. There is Qt::KeypadModifier, which is the one you are looking for. (I guess).