mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-08 19:23:28 +02:00
Fix problem with ContextMenu triggering on button up and button down.
This is fixed by clearing the ButtonPressedMap in the KeyboardMouseDevice every update. Previously, this button would never be cleared, causing other controller actions mapped to the same button to have the incorrect state. In this case, ContextMenu action would become 2 when pressed and 1 when released, anytime after the right mouse button was pressed.
This commit is contained in:
parent
5796cbc898
commit
a0c42bacdb
1 changed files with 1 additions and 3 deletions
|
@ -25,6 +25,7 @@ void KeyboardMouseDevice::pluginUpdate(float deltaTime, const controller::InputC
|
|||
auto userInputMapper = DependencyManager::get<controller::UserInputMapper>();
|
||||
userInputMapper->withLock([&, this]() {
|
||||
_inputDevice->update(deltaTime, inputCalibrationData);
|
||||
eraseMouseClicked();
|
||||
|
||||
_inputDevice->_axisStateMap[MOUSE_AXIS_X] = _lastCursor.x();
|
||||
_inputDevice->_axisStateMap[MOUSE_AXIS_Y] = _lastCursor.y();
|
||||
|
@ -78,8 +79,6 @@ void KeyboardMouseDevice::mousePressEvent(QMouseEvent* event) {
|
|||
|
||||
_mousePressPos = event->pos();
|
||||
_clickDeadspotActive = true;
|
||||
|
||||
eraseMouseClicked();
|
||||
}
|
||||
|
||||
void KeyboardMouseDevice::mouseReleaseEvent(QMouseEvent* event) {
|
||||
|
@ -122,7 +121,6 @@ void KeyboardMouseDevice::mouseMoveEvent(QMouseEvent* event) {
|
|||
|
||||
const int CLICK_EVENT_DEADSPOT = 6; // pixels
|
||||
if (_clickDeadspotActive && (_mousePressPos - currentPos).manhattanLength() > CLICK_EVENT_DEADSPOT) {
|
||||
eraseMouseClicked();
|
||||
_clickDeadspotActive = false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue