Can you show your code that is dealing with the key events?
If you are using ascii() for these keys it wont work since they don't have an ascii() representation, you should use the Qt::Key value.
Can you show your code that is dealing with the key events?
If you are using ascii() for these keys it wont work since they don't have an ascii() representation, you should use the Qt::Key value.
I could receive the arrow press event but on enter press nothing is happening except a repeating ofOriginally Posted by high_flyer
other events (defined in the code).....
key_press is my global variable
void MyWidget::keyPressEvent(QKeyEvent *event)
{
if(event->key() == Qt::Key_Up) {
key_press = -1;
}am able to
else if(event->key() == Qt::Key_Down) {
key_press = 1;
}am able to
else if(event->key() == Qt::Key_Enter) {
key_press = 3; // But this part of the code is not reached on enter key press
}
else {
QWidget::keyPressEvent(event);
}
// other events....
}
Last edited by mahe2310; 16th February 2006 at 09:19. Reason: fail to include few ogf the statements ...
I had a similiar problem a day ago, i posted my solution in the end how to catch Tab, enter and space and so on.
http://www.qtcentre.org/forum/showthread.php?t=670
Originally Posted by lumber44
thanks lumber... That is a good one...
Mahe2310
Bookmarks