Browse Source

Made Mouse.Location read/write so it can WarpMouse.

Mark Sibly 8 years ago
parent
commit
544857eecc
1 changed files with 6 additions and 0 deletions
  1. 6 0
      modules/mojo/input/mouse.monkey2

+ 6 - 0
modules/mojo/input/mouse.monkey2

@@ -104,9 +104,15 @@ Class MouseDevice Extends InputDevice
 	End
 
 	#rem monkeydoc The mouse location.
+	
+	This property may be written to warp the mouse to a new location.
+	
 	#end
 	Property Location:Vec2i()
 		Return _location
+	Setter( location:Vec2i )
+		_location=location
+		SDL_WarpMouseInWindow( Null,location.x,location.y )
 	End
 	
 	#rem monkeydoc The mouse wheel delta x value since the last app update.