PDA

View Full Version : CTRL-+ in keyPressEvent



The_Fallen
12th May 2011, 21:39
Hi,

I'm currently trying to react on pressing CTRL-+ (i.e. holding CTRL and pressing +) in a keyPressEvent.
Unfortunately this doesn't work properly, since event->key() gives me two different key codes for the + key, depending on whether CTRL is pressed or not. If no CTRL is pressed, the correct key code (43) is given, otherwise I get the key code 93, which seems to be a closing bracket.
I'm using a German keyboard layout, could that be a problem? Or what else am I doing wrong?

Cheers,
fallen

rsilva
12th May 2011, 23:40
If you're using windows you can try event->nativeKeyCode() == VK_ADD and you will get the numpad plus key.