author | hash <hash> | 2002-08-22 04:33:16 (UTC) |
---|---|---|
committer | hash <hash> | 2002-08-22 04:33:16 (UTC) |
commit | ea0d66f137984689c4d4ef6da7dd4b7323760e8c (patch) (unidiff) | |
tree | 75332072b67132ef7fd7559578b7f02405d69a88 /inputmethods/multikey/keyboard.cpp | |
parent | ee90b966cfc262770ef5a45c2bad0af6766245a2 (diff) | |
download | opie-ea0d66f137984689c4d4ef6da7dd4b7323760e8c.zip opie-ea0d66f137984689c4d4ef6da7dd4b7323760e8c.tar.gz opie-ea0d66f137984689c4d4ef6da7dd4b7323760e8c.tar.bz2 |
fixed nasty bug related to ctrl and alt keys
Diffstat (limited to 'inputmethods/multikey/keyboard.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | inputmethods/multikey/keyboard.cpp | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/inputmethods/multikey/keyboard.cpp b/inputmethods/multikey/keyboard.cpp index d5a7afd..7098a6b 100644 --- a/inputmethods/multikey/keyboard.cpp +++ b/inputmethods/multikey/keyboard.cpp | |||
@@ -281,56 +281,74 @@ void Keyboard::mousePressEvent(QMouseEvent *e) | |||
281 | if (qkeycode == Qt::Key_F1) { // toggle the pickboard | 281 | if (qkeycode == Qt::Key_F1) { // toggle the pickboard |
282 | 282 | ||
283 | if ( configdlg ) { | 283 | if ( configdlg ) { |
284 | delete (ConfigDlg *) configdlg; | 284 | delete (ConfigDlg *) configdlg; |
285 | configdlg = 0; | 285 | configdlg = 0; |
286 | } | 286 | } |
287 | else { | 287 | else { |
288 | configdlg = new ConfigDlg (); | 288 | configdlg = new ConfigDlg (); |
289 | connect(configdlg, SIGNAL(setMapToDefault()), | 289 | connect(configdlg, SIGNAL(setMapToDefault()), |
290 | this, SLOT(setMapToDefault())); | 290 | this, SLOT(setMapToDefault())); |
291 | connect(configdlg, SIGNAL(setMapToFile(QString)), | 291 | connect(configdlg, SIGNAL(setMapToFile(QString)), |
292 | this, SLOT(setMapToFile(QString))); | 292 | this, SLOT(setMapToFile(QString))); |
293 | connect(configdlg, SIGNAL(pickboardToggled(bool)), | 293 | connect(configdlg, SIGNAL(pickboardToggled(bool)), |
294 | this, SLOT(togglePickboard(bool))); | 294 | this, SLOT(togglePickboard(bool))); |
295 | connect(configdlg, SIGNAL(repeatToggled(bool)), | 295 | connect(configdlg, SIGNAL(repeatToggled(bool)), |
296 | this, SLOT(toggleRepeat(bool))); | 296 | this, SLOT(toggleRepeat(bool))); |
297 | connect(configdlg, SIGNAL(reloadKeyboard()), | 297 | connect(configdlg, SIGNAL(reloadKeyboard()), |
298 | this, SLOT(reloadKeyboard())); | 298 | this, SLOT(reloadKeyboard())); |
299 | configdlg->showMaximized(); | 299 | configdlg->showMaximized(); |
300 | configdlg->show(); | 300 | configdlg->show(); |
301 | configdlg->raise(); | 301 | configdlg->raise(); |
302 | } | 302 | } |
303 | 303 | ||
304 | } else if (qkeycode == Qt::Key_Control) { | 304 | } else if (qkeycode == Qt::Key_Control) { |
305 | ctrl = keys->pressedPtr(row, col); | 305 | |
306 | need_repaint = TRUE; | 306 | if (ctrl) { |
307 | *ctrl = !keys->pressed(row, col); | 307 | |
308 | *ctrl = 0; | ||
309 | ctrl = 0; | ||
310 | |||
311 | } else { | ||
312 | |||
313 | ctrl = keys->pressedPtr(row, col); | ||
314 | need_repaint = TRUE; | ||
315 | *ctrl = !keys->pressed(row, col); | ||
316 | |||
317 | } | ||
308 | 318 | ||
309 | } else if (qkeycode == Qt::Key_Alt) { | 319 | } else if (qkeycode == Qt::Key_Alt) { |
310 | alt = keys->pressedPtr(row, col); | 320 | |
311 | need_repaint = TRUE; | 321 | if (alt) { |
312 | *alt = !keys->pressed(row, col); | 322 | *alt = 0; |
323 | alt = 0; | ||
324 | |||
325 | } else { | ||
326 | |||
327 | alt = keys->pressedPtr(row, col); | ||
328 | need_repaint = TRUE; | ||
329 | *alt = !keys->pressed(row, col); | ||
330 | } | ||
313 | 331 | ||
314 | } else if (qkeycode == Qt::Key_Shift) { | 332 | } else if (qkeycode == Qt::Key_Shift) { |
315 | need_repaint = TRUE; | 333 | need_repaint = TRUE; |
316 | 334 | ||
317 | if (shift) { | 335 | if (shift) { |
318 | *shift = 0; | 336 | *shift = 0; |
319 | shift = 0; | 337 | shift = 0; |
320 | } | 338 | } |
321 | else { | 339 | else { |
322 | shift = keys->pressedPtr(row, col); | 340 | shift = keys->pressedPtr(row, col); |
323 | *shift = 1; | 341 | *shift = 1; |
324 | if (lock) { | 342 | if (lock) { |
325 | *lock = 0; | 343 | *lock = 0; |
326 | lock = 0; | 344 | lock = 0; |
327 | } | 345 | } |
328 | } | 346 | } |
329 | 347 | ||
330 | } else if (qkeycode == Qt::Key_CapsLock) { | 348 | } else if (qkeycode == Qt::Key_CapsLock) { |
331 | need_repaint = TRUE; | 349 | need_repaint = TRUE; |
332 | 350 | ||
333 | if (lock) { | 351 | if (lock) { |
334 | *lock = 0; | 352 | *lock = 0; |
335 | lock = 0; | 353 | lock = 0; |
336 | } | 354 | } |