Changeset 379 for trunk/src/gui/kernel/qkeymapper_pm.cpp
- Timestamp:
- Dec 4, 2009, 2:37:54 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gui/kernel/qkeymapper_pm.cpp
r353 r379 71 71 KeyRecorder() : nrecs(0) {} 72 72 73 inline KeyRecord *findKey(int code, bool remove);73 inline KeyRecord *findKey(int scan, bool remove); 74 74 inline void storeKey(int scan, int code, int state, const QString& text); 75 75 inline void clearKeys(); … … 84 84 { 85 85 KeyRecord *result = 0; 86 87 if(scan == 0) // DBCS chars or user-injected keys 88 return result; 89 86 90 for (int i = 0; i < nrecs; ++i) { 87 91 if (records[i].scan == scan) { … … 106 110 void KeyRecorder::storeKey(int scan, int code, int state, const QString& text) 107 111 { 112 if(scan == 0 && code == 0) // DBCS chars or user-injected keys 113 return; 114 108 115 Q_ASSERT_X(nrecs != QT_MAX_KEY_RECORDINGS, 109 116 "Internal KeyRecorder", … … 369 376 state = state ^ Qt::MetaModifier; 370 377 378 // Note: code and/or chm.scancode may be zero here. We cannot ignore such 379 // events because, for example, all non-ASCII letters have zero virtual 380 // codes, and DBCS characters entered via IME have both zero virtual codes 381 // and zero scancodes. However, if both code and chm.scancode are zero 382 // (as for DBCS), storeKey()/findKey() will do nothing which means that: 383 // 384 // 1) QKeyEvents will not have the auto-repeat flag set when a key is 385 // being auto-repeated by the system; 386 // 2) there will be no QEvent::KeyRelease event corresponding to the 387 // QEvent::KeyPress event. 388 // 389 // This seems to be acceptable. 390 371 391 // KEYDOWN ----------------------------------------------------------------- 372 392 if (!(chm.fs & KC_KEYUP)) {
Note:
See TracChangeset
for help on using the changeset viewer.