1
0
Fork 0

GUI: fixed a very annoying bug on some systems with the '^' character being inserted after the '6' without shift pressed

This commit is contained in:
Mr. eXoDia 2014-06-23 23:08:08 +02:00
parent 4a8a44764e
commit 2cb45f1d7a
2 changed files with 15 additions and 3 deletions

View File

@ -1,4 +1,5 @@
#include "HistoryLineEdit.h"
#include "Bridge.h"
HistoryLineEdit::HistoryLineEdit(QWidget *parent) : QLineEdit(parent)
{
@ -20,6 +21,19 @@ void HistoryLineEdit::keyPressEvent(QKeyEvent* event)
{
int wKey = event->key();
//This fixes a very annoying bug on some systems
if(bSixPressed)
{
bSixPressed=false;
if(event->text()=="^")
{
event->ignore();
return;
}
}
if(wKey == Qt::Key_6)
bSixPressed=true;
if(wKey == Qt::Key_Up || wKey == Qt::Key_Down)
{
if(wKey == Qt::Key_Up)

View File

@ -17,12 +17,10 @@ public:
signals:
void keyPressed(int parKey);
public slots:
private:
QList<QString> mCmdHistory;
int mCmdIndex;
bool bSixPressed;
};