Added ignoring of keyboard shortcuts to keyboard_pad_handler

This fixes an issue where pressing keyboard shortcuts will input them to
the game.
This commit is contained in:
Peter Mcteague 2017-08-27 18:38:52 +01:00 committed by Ani
parent be46c82aaa
commit 5326912bc0

View File

@ -1,4 +1,4 @@
#include "stdafx.h"
#include "stdafx.h"
#include "keyboard_pad_handler.h"
@ -60,9 +60,40 @@ void keyboard_pad_handler::keyPressEvent(QKeyEvent* event)
event->ignore();
return;
}
Key(event->key(), 1);
event->ignore();
switch (event->key())
{
case Qt::Key_L:
if (!(event->modifiers() == Qt::AltModifier)) { Key(event->key(), 1); }
event->ignore();
break;
case Qt::Key_Return:
if (!(event->modifiers() == Qt::AltModifier)) { Key(event->key(), 1); }
break;
event->ignore();
case Qt::Key_Escape:
event->ignore();
break;
case Qt::Key_P:
if (!(event->modifiers() == Qt::ControlModifier)) { Key(event->key(), 1); }
event->ignore();
break;
case Qt::Key_S:
if (!(event->modifiers() == Qt::ControlModifier)) { Key(event->key(), 1); }
event->ignore();
break;
case Qt::Key_R:
if (!(event->modifiers() == Qt::ControlModifier)) { Key(event->key(), 1); }
event->ignore();
break;
case Qt::Key_E:
if (!(event->modifiers() == Qt::ControlModifier)) { Key(event->key(), 1); }
event->ignore();
break;
default:
Key(event->key(), 1);
event->ignore();
break;
}
}
void keyboard_pad_handler::keyReleaseEvent(QKeyEvent* event)