summaryrefslogtreecommitdiff
path: root/inputmethods/jumpx/keyboard.cpp
Unidiff
Diffstat (limited to 'inputmethods/jumpx/keyboard.cpp') (more/less context) (show whitespace changes)
-rw-r--r--inputmethods/jumpx/keyboard.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/inputmethods/jumpx/keyboard.cpp b/inputmethods/jumpx/keyboard.cpp
index 0b8fc14..0cfb4be 100644
--- a/inputmethods/jumpx/keyboard.cpp
+++ b/inputmethods/jumpx/keyboard.cpp
@@ -79,96 +79,97 @@ static const uchar *const letterMapShift[] = {
79 (const uchar *const)"GDORSB", 79 (const uchar *const)"GDORSB",
80 (const uchar *const)"QJUMPX", 80 (const uchar *const)"QJUMPX",
81}; 81};
82 82
83static const uchar *const num1Map = (const uchar *const)"12345"; 83static const uchar *const num1Map = (const uchar *const)"12345";
84 84
85static const uchar *const specialMap[] = { 85static const uchar *const specialMap[] = {
86 (const uchar *const)"-+", 86 (const uchar *const)"-+",
87 (const uchar *const)"*!", 87 (const uchar *const)"*!",
88 (const uchar *const)",'", 88 (const uchar *const)",'",
89 (const uchar *const)".%", 89 (const uchar *const)".%",
90 (const uchar *const)"/$", 90 (const uchar *const)"/$",
91}; 91};
92 92
93static const uchar *const specialMapShift[] = { 93static const uchar *const specialMapShift[] = {
94 (const uchar *const)"_=", 94 (const uchar *const)"_=",
95 (const uchar *const)"#?", 95 (const uchar *const)"#?",
96 (const uchar *const)";\"", 96 (const uchar *const)";\"",
97 (const uchar *const)":|", 97 (const uchar *const)":|",
98 (const uchar *const)"\\&", 98 (const uchar *const)"\\&",
99}; 99};
100 100
101static const uchar *const specialMapParen[] = { 101static const uchar *const specialMapParen[] = {
102 (const uchar *const)"()", 102 (const uchar *const)"()",
103 (const uchar *const)"[]", 103 (const uchar *const)"[]",
104 (const uchar *const)"{}", 104 (const uchar *const)"{}",
105 (const uchar *const)"<>", 105 (const uchar *const)"<>",
106 (const uchar *const)"@~", 106 (const uchar *const)"@~",
107}; 107};
108 108
109static const uchar *const num2Map = (const uchar *const)"67890"; 109static const uchar *const num2Map = (const uchar *const)"67890";
110 110
111static const mapElement mod2Map[] = { 111static const mapElement mod2Map[] = {
112 { Qt::Key_Backspace, 8 }, 112 { Qt::Key_Backspace, 8 },
113 { Qt::Key_Delete, 0 }, 113 { Qt::Key_Delete, 0 },
114 { Qt::Key_Return, 13 }, 114 { Qt::Key_Return, 13 },
115 { Qt::Key_Shift, 0 }, 115 { Qt::Key_Shift, 0 },
116 { myParenID, 0 }, 116 { myParenID, 0 },
117}; 117};
118 118
119static const int cursorMap[][2] = { 119static const int cursorMap[][2] = {
120 { Qt::Key_Home, Qt::Key_PageUp }, 120 { Qt::Key_Home, Qt::Key_PageUp },
121 { Qt::Key_End, Qt::Key_PageDown }, 121 { Qt::Key_End, Qt::Key_PageDown },
122 { Qt::Key_Up, Qt::Key_Up }, 122 { Qt::Key_Up, Qt::Key_Up },
123 { Qt::Key_Left, Qt::Key_Right }, 123 { Qt::Key_Left, Qt::Key_Right },
124 { Qt::Key_Down, Qt::Key_Down }, 124 { Qt::Key_Down, Qt::Key_Down },
125}; 125};
126 126
127using namespace JumpX;
127 128
128Keyboard::Keyboard(QWidget* parent, const char* name, WFlags f) : 129Keyboard::Keyboard(QWidget* parent, const char* name, WFlags f) :
129 QFrame(parent, name, f), 130 QFrame(parent, name, f),
130 shift(0), paren(0), ctrl(0), alt(0), 131 shift(0), paren(0), ctrl(0), alt(0),
131 pressedKeyUnicode(0), pressedKeyQcode(0), pressedMod(0), 132 pressedKeyUnicode(0), pressedKeyQcode(0), pressedMod(0),
132 isnoncont(false), 133 isnoncont(false),
133 slideKeyUnicodeH(0), slideKeyQcodeH(0), slideKeyUnicodeV(0), slideKeyQcodeV(0), 134 slideKeyUnicodeH(0), slideKeyQcodeH(0), slideKeyUnicodeV(0), slideKeyQcodeV(0),
134 enableMouseTracking(false), slidePix(NULL), slidePixH(NULL), slidePixV(NULL), 135 enableMouseTracking(false), slidePix(NULL), slidePixH(NULL), slidePixV(NULL),
135 releasedPix(NULL), pressedPix(NULL) 136 releasedPix(NULL), pressedPix(NULL)
136{ 137{
137 //setPalette(QPalette(QColor(240,240,230))); // Beige! 138 //setPalette(QPalette(QColor(240,240,230))); // Beige!
138 139
139 releasedPlain = releasedShift = releasedParen = Resource::loadPixmap("jumpx/released"); 140 releasedPlain = releasedShift = releasedParen = Resource::loadPixmap("jumpx/released");
140 pressedPlain = pressedShift = pressedParen = Resource::loadPixmap("jumpx/pressed"); 141 pressedPlain = pressedShift = pressedParen = Resource::loadPixmap("jumpx/pressed");
141 pressedDigit = Resource::loadPixmap("jumpx/pressed"); 142 pressedDigit = Resource::loadPixmap("jumpx/pressed");
142 143
143 QPixmap tmp; 144 QPixmap tmp;
144 145
145 tmp = Resource::loadPixmap("jumpx/releasedShift"); 146 tmp = Resource::loadPixmap("jumpx/releasedShift");
146 bitBlt(&releasedShift, letterx1, 0, &tmp); 147 bitBlt(&releasedShift, letterx1, 0, &tmp);
147 148
148 tmp = Resource::loadPixmap("jumpx/releasedParen"); 149 tmp = Resource::loadPixmap("jumpx/releasedParen");
149 bitBlt(&releasedParen, specialx1, 0, &tmp); 150 bitBlt(&releasedParen, specialx1, 0, &tmp);
150 151
151 tmp = Resource::loadPixmap("jumpx/pressedShift"); 152 tmp = Resource::loadPixmap("jumpx/pressedShift");
152 bitBlt(&pressedShift, letterx1, 0, &tmp); 153 bitBlt(&pressedShift, letterx1, 0, &tmp);
153 154
154 tmp = Resource::loadPixmap("jumpx/pressedParen"); 155 tmp = Resource::loadPixmap("jumpx/pressedParen");
155 bitBlt(&pressedParen, specialx1, 0, &tmp); 156 bitBlt(&pressedParen, specialx1, 0, &tmp);
156 157
157 tmp = Resource::loadPixmap("jumpx/pressedDigit"); 158 tmp = Resource::loadPixmap("jumpx/pressedDigit");
158 bitBlt(&pressedDigit, specialx1, 0, &tmp); 159 bitBlt(&pressedDigit, specialx1, 0, &tmp);
159 160
160 offscreen = QPixmap( releasedPlain ); 161 offscreen = QPixmap( releasedPlain );
161 162
162 releasedPix = &releasedPlain; 163 releasedPix = &releasedPlain;
163 pressedPix = &pressedPlain; 164 pressedPix = &pressedPlain;
164 slidePix = &pressedPlain; 165 slidePix = &pressedPlain;
165 166
166 delayTimer = new QTimer(this); 167 delayTimer = new QTimer(this);
167 rateTimer = new QTimer(this); 168 rateTimer = new QTimer(this);
168 connect( delayTimer, SIGNAL( timeout() ), this, SLOT( delayTimerDone() ) ); 169 connect( delayTimer, SIGNAL( timeout() ), this, SLOT( delayTimerDone() ) );
169 connect( rateTimer, SIGNAL( timeout() ), this, SLOT( rateTimerDone() ) ); 170 connect( rateTimer, SIGNAL( timeout() ), this, SLOT( rateTimerDone() ) );
170} 171}
171 172
172void Keyboard::resizeEvent(QResizeEvent*) 173void Keyboard::resizeEvent(QResizeEvent*)
173{ 174{
174 //cout << "resizeEvent()" << endl; 175 //cout << "resizeEvent()" << endl;