if (key == Qt::Key_Escape)
break;
- // Otherwise, populate the appropriate spot in the settings & update screen...
+ // Otherwise, populate the appropriate spot in the settings & update
+ // the screen...
controllerWidget->keys[orderToDefine[i]] = key;
controllerWidget->update();
profile[profileNum].map[orderToDefine[i]] = key;
void ControllerWidget::mouseReleaseEvent(QMouseEvent * /*event*/)
{
mouseDown = false;
- // Spawning the keygrabber causes leaveEvent() to be called, so we need to save this
+ // Spawning the keygrabber causes leaveEvent() to be called, so we need to
+ // save this
int keyToHighlightSave = keyToHighlight;
KeyGrabber keyGrab(this);
#include "gamepad.h"
+// Class variables
+// These need to be preserved between calls to this class, otherwise bad stuff
+// (like controllers not working correctly) can happen.
+/*static*/ bool KeyGrabber::buttonDown = false;
+/*static*/ int KeyGrabber::button = -1;
+
+
KeyGrabber::KeyGrabber(QWidget * parent/*= 0*/): QDialog(parent),
- label(new QLabel), timer(new QTimer), buttonDown(false)
+ label(new QLabel), timer(new QTimer)//, buttonDown(false)
{
// label = new QLabel(this);
QVBoxLayout * mainLayout = new QVBoxLayout;
private:
QLabel * label;
QTimer * timer;
- bool buttonDown;
- int button;
+ static bool buttonDown; // Class variable
+ static int button; // Class variable
public:
int key;