summaryrefslogtreecommitdiff
path: root/inputmethods/jumpx/keyboard.h
Unidiff
Diffstat (limited to 'inputmethods/jumpx/keyboard.h') (more/less context) (ignore whitespace changes)
-rw-r--r--inputmethods/jumpx/keyboard.h71
1 files changed, 71 insertions, 0 deletions
diff --git a/inputmethods/jumpx/keyboard.h b/inputmethods/jumpx/keyboard.h
new file mode 100644
index 0000000..1be095d
--- a/dev/null
+++ b/inputmethods/jumpx/keyboard.h
@@ -0,0 +1,71 @@
1/**************************************************************************************94x78**
2**
3** This file may be distributed and/or modified under the terms of the
4** GNU General Public License version 2 as published by the Free Software
5** Foundation and appearing in the file LICENSE.GPL included in the
6** packaging of this file.
7**
8** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
9** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
10**
11*********************************************************************************************/
12#include <qframe.h>
13#include <qpixmap.h>
14#include <qtimer.h>
15
16class Keyboard : public QFrame
17{
18 Q_OBJECT
19public:
20 Keyboard( QWidget* parent=0, const char* name=0, WFlags f=0 );
21
22 void resetState();
23
24 void mousePressEvent(QMouseEvent*);
25 void mouseReleaseEvent(QMouseEvent*);
26 void mouseMoveEvent(QMouseEvent*);
27 void resizeEvent(QResizeEvent*);
28 void paintEvent(QPaintEvent* e);
29 //void timerEvent(QTimerEvent* e);
30
31 QSize sizeHint() const;
32
33signals:
34 void key( ushort unicode, ushort qcode, ushort modifiers, bool, bool );
35
36private slots:
37 void delayTimerDone();
38 void rateTimerDone();
39
40private:
41 int shift; // 0, 1, 2
42 int paren; // 0, 1, 2
43 int ctrl; // 0, 1
44 int alt; // 0, 1
45
46 int pressedKeyUnicode, pressedKeyQcode, pressedMod;
47 int pressedx, pressedy, pressedw, pressedh;
48 bool isnoncont;
49 int pressed2x, pressed2y, pressed2w, pressed2h;
50
51 int slideKeyUnicodeH, slideKeyQcodeH, slideKeyUnicodeV, slideKeyQcodeV;
52 bool enableMouseTracking;
53 QPixmap *slidePix, *slidePixH, *slidePixV;
54
55 QPixmap releasedPlain;
56 QPixmap releasedShift;
57 QPixmap releasedParen;
58
59 QPixmap pressedPlain;
60 QPixmap pressedShift;
61 QPixmap pressedParen;
62 QPixmap pressedDigit;
63
64 QPixmap offscreen;
65
66 QPixmap *releasedPix;
67 QPixmap *pressedPix;
68
69 QTimer *delayTimer;
70 QTimer *rateTimer;
71};