Open HelmuthWcs opened 4 years ago
Same is true for keyboard input.
Mouse.PrimaryWindow
is not set. That seems to be the case because the Game
class is not used, where it is usually set.
Mouse.PrimaryWindow
is not set. That seems to be the case because theGame
class is not used, where it is usually set.
Have you found a solution? PrimaryWindow is an internal variable, so I cannot manually set it. Any work around?
Mouse.PrimaryWindow
is not set. That seems to be the case because theGame
class is not used, where it is usually set.Have you found a solution? PrimaryWindow is an internal variable, so I cannot manually set it. Any work around?
Okay, I found a workaround. I just use the System.Windows.Input Keyboard and Mouse objects to handle input. Seems to work about the same. Although I'm trying to figure out a good solution for storing previous states. Using the monogame input objects, you can get the state of every key being pressed and store it. You have to solve this issue your self. For mouse input, this isn't that bad because there's only three buttons, but for keyboard, I suppose you could loop through every value in the Keys enum. Or you could get fancy and only do it for certain keys; Something like mapping controls to certain keys and only checking those ones.
Working solution in this project for Mouse and Keyboard states:
thta project handles iMG nput but for my level editor i stick wiht the windows input... i just want to draw the stuff...this one is simpler... its almost better to build an in game editor in some cases....i use an input manager and map key to gamepad like buttons .. issue is threading and polling as well in WPF...
I am trying to get mouse input to work like this in the update method as usual:
if (Mouse.GetState().LeftButton == ButtonState.Pressed)
This is just using the sample project and does not pick up any type of clicks.