If this is a QWidget app, add something like the following to your class declaration:
protected:
protected:
void keyPressEvent(QKeyEvent *event);
To copy to clipboard, switch view to plain text mode
Then something like this to the implementation of keyPressEvent:
switch(event->key()){
case Qt::Key_Up:
do stuff for the up arrow
break;
case Qt::Key_Left:
do stuff for the left arrow.
break;
case Qt::Key_Right:
do stuff for the right arrow.
break;
case Qt::Key_Down:
do stuff for the down arrow.
break;
case Qt::Key_0:
break;
}
switch(event->key()){
case Qt::Key_Up:
do stuff for the up arrow
break;
case Qt::Key_Left:
do stuff for the left arrow.
break;
case Qt::Key_Right:
do stuff for the right arrow.
break;
case Qt::Key_Down:
do stuff for the down arrow.
break;
case Qt::Key_0:
break;
}
To copy to clipboard, switch view to plain text mode
Karl
Bookmarks