You can get the key that was pressed by using a key()
function. The list of codes for the keys can be found at this doc page. So, if you want your A
key, you can either do
keyPressEvent( QKeyEvent * event )
{
if( event->key() == Qt::Key_A )
{
// do your stuff here
}
}
or use the key code directly:
if( event->key() == 0x41 )
{
// do your stuff here
}