Skip to content
This repository has been archived by the owner on Aug 22, 2018. It is now read-only.

Input.IsMouseButtonDown bugged when multiple mouse buttons are held down #675

Open
RSoeborg opened this issue Jul 5, 2018 · 0 comments
Open

Comments

@RSoeborg
Copy link

RSoeborg commented Jul 5, 2018

If you use Input.IsMouseButtonDown to check if one button is held down then it works fine, however; if you use it to check if more mouse buttons are down at the same time then it is bugged.

Releasing one mouse button (either left or right) makes it clear the Input.DownButtons array. This means that if you for example hold down both left and right mouse button, then release right mosue button it will say that left mouse button is also released.

Steps to reproduce:
Create a 'New Game'
go into BasicCameraController.cs

Change line 118 from
if (Input.IsMouseButtonDown(MouseButton.Right))
to
if (Input.IsMouseButtonDown(MouseButton.Right) || Input.IsKeyDown(Keys.Left))

Start the game. Hold down both mouse buttons to look around, then only release one mouse button while still holding down the other. This will cause the MousePosition to be unlocked.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant