On Windows, using MonoGame.Framework.WindowsDX 3.7.0.944.
(Windows 10, but not “UWP” app; Surface Pro (2017))
If use MonoGame template, the following code in Game.Update override sees changed MouseState each loop.
C#:
MouseState mouseState = Mouse.GetState();
if (mouseState.X != 0)
{
int i = 1; // Breakpoint here.
}
if (mouseState.RightButton == ButtonState.Pressed)
{
int i = 1; // Breakpoint here.
}
Putting the same code into a desktop application that uses custom code to do the looping (no Game class), the MouseState never changes from default (0,0), no buttons pressed.
VB (breakpoints never hit):
Dim mouseState As MouseState = Mouse.GetState
If mouseState.X <> 0 Then
Test()
End If
If mouseState.RightButton = ButtonState.Pressed Then
Test()
End If
NOTE: FrameworkDispatcher.Update()
is called per loop; adding to the code used in this topic.
Q: What do I need to do to initialize the Mouse class?