| 464 | } |
| 465 | |
| 466 | void KeypadWidget::touchEnd() { |
| 467 | for (KeyCode code : mTouched) { |
| 468 | if (Key *key = mKeys[code.row()][code.col()]) { |
| 469 | bool wasSelected = key->isSelected(); |
| 470 | key->release(); |
| 471 | updateKey(key, wasSelected); |
| 472 | } |
| 473 | } |
| 474 | mTouched.clear(); |
| 475 | |
| 476 | // release any other keys that may be stuck?? |
| 477 | for (uint8_t row = 0; row != sRows; ++row) { |
| 478 | for (uint8_t col = 0; col != sCols; ++col) { |
| 479 | if (Key *key = mKeys[row][col]) { |
| 480 | bool selected = key->isSelected(); |
| 481 | if (selected) { |
| 482 | key->release(); |
| 483 | updateKey(key, selected); |
| 484 | } |
| 485 | } |
| 486 | } |
| 487 | } |
| 488 | } |
| 489 | |
| 490 | void KeypadWidget::touchEvent(QTouchEvent *event) { |
| 491 | switch (event->type()) { |
nothing calls this directly
no test coverage detected