summaryrefslogtreecommitdiff
path: root/inputmethods/dvorak/dvorak.h
authorjeremy <jeremy>2002-02-10 00:12:58 (UTC)
committer jeremy <jeremy>2002-02-10 00:12:58 (UTC)
commit686e536fb6a978019eebc967cb04cd2df738f06c (patch) (unidiff)
tree23fd4a97cd8b19cc6ea61fa75e3d72e23e9b591a /inputmethods/dvorak/dvorak.h
parent864a3a1dc5bdcae601626aa1f6b3cf8e85385cf3 (diff)
downloadopie-686e536fb6a978019eebc967cb04cd2df738f06c.zip
opie-686e536fb6a978019eebc967cb04cd2df738f06c.tar.gz
opie-686e536fb6a978019eebc967cb04cd2df738f06c.tar.bz2
Initial commit of the dvorak keyboard.... Dvorak keyboard input method for the Opie environment. This is based off
of the original keyboard input method.
Diffstat (limited to 'inputmethods/dvorak/dvorak.h') (more/less context) (ignore whitespace changes)
-rw-r--r--inputmethods/dvorak/dvorak.h103
1 files changed, 103 insertions, 0 deletions
diff --git a/inputmethods/dvorak/dvorak.h b/inputmethods/dvorak/dvorak.h
new file mode 100644
index 0000000..38ae338
--- a/dev/null
+++ b/inputmethods/dvorak/dvorak.h
@@ -0,0 +1,103 @@
1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3**
4** This file is part of Qtopia Environment.
5**
6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file.
10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15**
16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you.
18**
19**********************************************************************/
20#include <qframe.h>
21#include "../pickboard/pickboardcfg.h"
22#include "../pickboard/pickboardpicks.h"
23
24class QTimer;
25
26class KeyboardConfig : public DictFilterConfig
27{
28public:
29 KeyboardConfig(PickboardPicks* p) : DictFilterConfig(p), backspaces(0) { nrows = 1; }
30 virtual void generateText(const QString &s);
31 void decBackspaces() { if (backspaces) backspaces--; }
32 void incBackspaces() { backspaces++; }
33 void resetBackspaces() { backspaces = 0; }
34private:
35 int backspaces;
36};
37
38
39class KeyboardPicks : public PickboardPicks
40{
41 Q_OBJECT
42public:
43 KeyboardPicks(QWidget* parent=0, const char* name=0, WFlags f=0)
44 : PickboardPicks(parent, name, f) { }
45 void initialise();
46 virtual QSize sizeHint() const;
47 KeyboardConfig *dc;
48};
49
50class Keyboard : public QFrame
51{
52 Q_OBJECT
53public:
54 Keyboard( QWidget* parent=0, const char* name=0, WFlags f=0 );
55
56 void resetState();
57
58 void mousePressEvent(QMouseEvent*);
59 void mouseReleaseEvent(QMouseEvent*);
60 void resizeEvent(QResizeEvent*);
61 void paintEvent(QPaintEvent* e);
62 void timerEvent(QTimerEvent* e);
63 void drawKeyboard( QPainter &p, int key = -1 );
64
65 void setMode(int mode) { useOptiKeys = mode; }
66
67 QSize sizeHint() const;
68
69signals:
70 void key( ushort scancode, ushort unicode, ushort modifiers, bool, bool );
71
72private slots:
73 void repeat();
74
75private:
76 int getKey( int &w, int j = -1 );
77 void clearHighlight();
78
79 uint shift:1;
80 uint lock:1;
81 uint ctrl:1;
82 uint alt:1;
83 uint useLargeKeys:1;
84 uint useOptiKeys:1;
85
86 int pressedKey;
87
88 KeyboardPicks *picks;
89
90 int keyHeight;
91 int defaultKeyWidth;
92 int xoffs;
93
94 int unicode;
95 int qkeycode;
96 int modifiers;
97
98 int pressTid;
99 bool pressed;
100
101 QTimer *repeatTimer;
102};
103