From 5326912bc0fa9fb668dfa6e6d1b212e545873bb9 Mon Sep 17 00:00:00 2001 From: Peter Mcteague <07mcteaguepet@googlemail.com> Date: Sun, 27 Aug 2017 18:38:52 +0100 Subject: [PATCH] Added ignoring of keyboard shortcuts to keyboard_pad_handler This fixes an issue where pressing keyboard shortcuts will input them to the game. --- rpcs3/keyboard_pad_handler.cpp | 39 ++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/rpcs3/keyboard_pad_handler.cpp b/rpcs3/keyboard_pad_handler.cpp index 53814b3f80..8fd5355d3e 100644 --- a/rpcs3/keyboard_pad_handler.cpp +++ b/rpcs3/keyboard_pad_handler.cpp @@ -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)