summaryrefslogtreecommitdiff
path: root/inputmethods
Unidiff
Diffstat (limited to 'inputmethods') (more/less context) (ignore whitespace changes)
-rw-r--r--inputmethods/multikey/keyboard.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/inputmethods/multikey/keyboard.cpp b/inputmethods/multikey/keyboard.cpp
index 949164a..d5a7afd 100644
--- a/inputmethods/multikey/keyboard.cpp
+++ b/inputmethods/multikey/keyboard.cpp
@@ -262,12 +262,14 @@ void Keyboard::mousePressEvent(QMouseEvent *e)
262 int col = 0; 262 int col = 0;
263 for (int w = 0; e->x() >= w; col++) 263 for (int w = 0; e->x() >= w; col++)
264 if (col < keys->numKeys(row)) // it segfaults if it trys to read past numKeys 264 if (col < keys->numKeys(row)) // it segfaults if it trys to read past numKeys
265 w += keys->width(row,col) * defaultKeyWidth; 265 w += keys->width(row,col) * defaultKeyWidth;
266 else break; 266 else break;
267 267
268 if (col <= 0) return;
269
268 col --; // rewind one... 270 col --; // rewind one...
269 271
270 qkeycode = keys->qcode(row, col); 272 qkeycode = keys->qcode(row, col);
271 unicode = keys->uni(row, col); 273 unicode = keys->uni(row, col);
272 274
273 // might need to repaint if two or more of the same keys. 275 // might need to repaint if two or more of the same keys.