Hello. I have a really weird problem. Whenever I try to get if the user pressed down on the mouse (clicked), via GetAsyncKeyState(), it only shows it some times. I tried the exact same code, but with another key Ex: A, and it works fine.
Here is the code.
public void GetMouse()
{
foreach (System.Int32 i in Enum.GetValues(typeof(Keys)))
{
XPos.Add((ushort)Cursor.Position.X);
YPos.Add((ushort)Cursor.Position.Y);
int pressed = GetAsyncKeyState(i);
if ((pressed == -32767))
{
if ((i == 1) || (i == 2))
Click.Add((ushort)i);
else
Click.Add(0);
}
else
Click.Add(0);
}
}
This goes through a loop, so it is always checking.
Oh, and also I've tried this on multiple windows, and such, and it still doesn't work.
Thank you so much, Glut.