PDA

View Full Version : which key press last this will be display on screen



kinjalp
24th February 2012, 10:34
Hi all,

we use key press and key release ...
we change color through stylesheet both the key press and key release...
we use two keys Q and W for that...
but problem is that when I press the "Q" and "W"together but one after another I want to see effect which is last key is press but I see on the screen both the key is press...
so How can I do this ???:confused:

Kinjal Dhagat

Spitfire
24th February 2012, 12:54
myClass::keyPressEvent( QKeyEvent* event )
{
if( event->isAutoRepear() ) // if it's not initial key press - do nothing
{
return;
}

// do your magic here
}

myClass::keyReleaseEvent( QKeyEvent* event )
{
if( event->isAutoRepear() ) // if it's not initial key press - do nothing
{
return;
}

// do your magic here
}