瀏覽代碼

Added window WarpMouse() method.

Brucey 3 年之前
父節點
當前提交
45117acbcc
共有 2 個文件被更改,包括 12 次插入1 次删除
  1. 1 0
      sdlvideo.mod/common.bmx
  2. 11 1
      sdlvideo.mod/sdlvideo.bmx

+ 1 - 0
sdlvideo.mod/common.bmx

@@ -126,6 +126,7 @@ Extern
 	Function SDL_DestroyWindow(handle:Byte Ptr)
 	Function SDL_RestoreWindow(handle:Byte Ptr)
 	Function SDL_SetWindowIcon(handle:Byte Ptr, surface:Byte Ptr)
+	Function SDL_WarpMouseInWindow(handle:Byte Ptr, x:Int, y:Int)
 
 	Function SDL_GetGrabbedWindow:Byte Ptr()
 	Function SDL_IsScreenSaverEnabled:Int()

+ 11 - 1
sdlvideo.mod/sdlvideo.bmx

@@ -434,12 +434,22 @@ Type TSDLWindow
 	End Method
 	
 	Rem
-	bbdoc: 
+	bbdoc: Returns the native window handle for this window.
 	End Rem
 	Method GetWindowHandle:Byte Ptr()
 		Return bmx_sdl_video_GetWindowHandle(windowPtr)
 	End Method
 	
+	Rem
+	bbdoc: Moves the mouse cursor to the given position within the window.
+	about: This method generates a mouse motion event.
+
+	Note that this method will appear to succeed, but not actually move the mouse when used over Microsoft Remote Desktop.
+	End Rem
+	Method WarpMouse(x:Int, y:Int)
+		SDL_WarpMouseInWindow(windowPtr, x, y)
+	End Method
+
 End Type
 
 Rem