Commit | Line | Data |
---|---|---|
cf76e892 JPM |
1 | #ifndef __CONTROLLERWIDGET_H__ |
2 | #define __CONTROLLERWIDGET_H__ | |
3 | ||
4 | #include <QtWidgets> | |
5 | #include <stdint.h> | |
6 | ||
7 | class ControllerWidget: public QWidget | |
8 | { | |
9 | Q_OBJECT | |
10 | ||
11 | public: | |
12 | ControllerWidget(QWidget * parent = 0); | |
13 | ~ControllerWidget(); | |
14 | QSize sizeHint(void) const; | |
15 | QSizePolicy sizePolicy(void) const; | |
16 | ||
17 | protected: | |
18 | void paintEvent(QPaintEvent *); | |
19 | void mousePressEvent(QMouseEvent *); | |
20 | void mouseReleaseEvent(QMouseEvent *); | |
21 | void mouseMoveEvent(QMouseEvent *); | |
22 | void leaveEvent(QEvent *); | |
23 | ||
24 | private: | |
25 | void DrawBorderedText(QPainter &, int, int, QString); | |
26 | ||
27 | signals: | |
28 | void KeyDefined(int, uint32_t); | |
29 | ||
30 | public: | |
31 | uint32_t keys[21]; | |
32 | ||
33 | private: | |
34 | QImage controllerPic; | |
35 | QSize widgetSize; | |
36 | int keyToHighlight; | |
37 | bool mouseDown; | |
38 | ||
39 | // Class data | |
40 | static char keyName1[96][16]; | |
41 | static char keyName2[64][16]; | |
42 | static char hatName[4][16]; | |
43 | static char axisName[2][8]; | |
44 | static int buttonPos[21][2]; | |
45 | }; | |
46 | ||
47 | #endif // __CONTROLLERWIDGET_H__ |