mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-29 15:58:33 +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) {
|
if (this.HandleMouse) {
|
||||||
this.LastMouseState = this.MouseState;
|
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) {
|
if (this.HandleGamepads) {
|
||||||
|
|
Loading…
Reference in a new issue