Skip to content

The ClientSimBaseInput::GetMouseButtonDown method ignored the button parameter, causing the mouse event to fire for the left, middle and right buttons at the same time when only one button is pressed. #131

Description

@yuxuanchiadm

The ClientSimBaseInput::GetMouseButtonDown method ignored the button parameter, causing the mouse event to fire for the left, middle and right buttons at the same time when only one button is pressed.

public override bool GetMouseButton(int button)
{
return _lastHandUsed == HandType.RIGHT ? _rightUseDown : _leftUseDown;
}
public override bool GetMouseButtonUp(int button)
{
return
_lastHandUsed == HandType.RIGHT
? (!_rightUseDown && _rightUseChangeTick == _frameTick)
: (!_leftUseDown && _leftUseChangeTick == _frameTick);
}
public override bool GetMouseButtonDown(int button)
{
return
_lastHandUsed == HandType.RIGHT
? (_rightUseDown && _rightUseChangeTick == _frameTick)
: (_leftUseDown && _leftUseChangeTick == _frameTick);
}

To replicate the issue: Add an Event System component to any UI. Then add a 'Pointer Down' event type.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions