MCPcopy Create free account
hub / github.com/CE-Programming/CEmu / mouseUpdate

Method mouseUpdate

gui/qt/keypad/keypadwidget.cpp:371–389  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

369}
370
371void KeypadWidget::mouseUpdate(const QPointF &pos) {
372 const QPainterPath area{pos * mInverseTransform};
373 for (uint8_t row = 0; row != sRows; ++row) {
374 for (uint8_t col = 0; col != sCols; ++col) {
375 if (Key *key = mKeys[row][col]) {
376 bool wasSelected = key->isSelected();
377 if (key->isUnder(area)) {
378 if (!mClicked.contains(key->keycode())) {
379 mClicked.insert(key->keycode());
380 key->press();
381 }
382 } else if (mClicked.remove(key->keycode())) {
383 key->release();
384 }
385 updateKey(key, wasSelected);
386 }
387 }
388 }
389}
390
391void KeypadWidget::mouseEnd(bool toggleHeld) {
392 for (KeyCode code : mClicked) {

Callers

nothing calls this directly

Calls 5

keycodeMethod · 0.80
pressMethod · 0.80
releaseMethod · 0.80
isSelectedMethod · 0.45
isUnderMethod · 0.45

Tested by

no test coverage detected