Skip to content

MSG_RAW_MOUSE_MIDDLE_BUTTON_UP uses a frame based click duration filter #1831

@xezon

Description

@xezon

MSG_RAW_MOUSE_MIDDLE_BUTTON_UP uses a frame based click duration filter, with m_timestamp.

This is a problem when the game logic speed is very high (or very slow).

The duration needs to be in actual real time. Perhaps there are more input actions like this that need fixing.

case GameMessage::MSG_RAW_MOUSE_MIDDLE_BUTTON_UP:
{
m_lastMouseMoveFrame = TheGameLogic->getFrame();
const UnsignedInt CLICK_DURATION = 5;
const UnsignedInt PIXEL_OFFSET = 5;
m_isRotating = false;
Int dx = m_currentPos.x-m_originalAnchor.x;
if (dx<0) dx = -dx;
Int dy = m_currentPos.y-m_originalAnchor.y;
Bool didMove = dx>PIXEL_OFFSET || dy>PIXEL_OFFSET;
// if middle button is "clicked", reset to "home" orientation
if (!didMove && TheGameClient->getFrame() - m_timestamp < CLICK_DURATION)
{
TheTacticalView->setAngleAndPitchToDefault();
TheTacticalView->setZoomToDefault();
}
break;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething is not working right, typically is user facingInputMinorSeverity: Minor < Major < Critical < Blocker

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions