]> Shamusworld >> Repos - virtualjaguar/blob - src/gui/keygrabber.h
More gamepad work.
[virtualjaguar] / src / gui / keygrabber.h
1 //
2 // keygrabber.h - Widget to grab a key and dismiss itself
3 //
4 // by James Hammons
5 // (C) 2011 Underground Software
6 //
7
8 #ifndef __KEYGRABBER_H__
9 #define __KEYGRABBER_H__
10
11 #include <QtGui>
12
13 class KeyGrabber: public QDialog
14 {
15         Q_OBJECT
16
17         public:
18                 KeyGrabber(QWidget * parent = 0);
19                 ~KeyGrabber();
20                 void SetKeyText(int);
21
22         protected:
23                 void keyPressEvent(QKeyEvent *);
24
25         private slots:
26                 void CheckGamepad();
27
28         private:
29                 QLabel * label;
30                 QTimer * timer;
31                 bool buttonDown;
32                 int button;
33
34         public:
35                 int key;
36 };
37
38 #endif  // __KEYGRABBER_H__