mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-12-27 02:29:23 +01:00
only handle mouse input if the mouse is in the window
This commit is contained in:
parent
01b6168259
commit
73eab1d41e
1 changed files with 6 additions and 1 deletions
|
@ -181,7 +181,12 @@ namespace MLEM.Input {
|
|||
|
||||
if (this.HandleMouse) {
|
||||
this.LastMouseState = this.MouseState;
|
||||
this.MouseState = active ? Mouse.GetState() : default;
|
||||
this.MouseState = default;
|
||||
if (active) {
|
||||
var state = Mouse.GetState();
|
||||
if (this.Game.GraphicsDevice.Viewport.Bounds.Contains(state.Position))
|
||||
this.MouseState = state;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.HandleGamepads) {
|
||||
|
|
Loading…
Reference in a new issue