Search the Community
Showing results for tags 'pen'.
-
Wondering how to detect the pen's cursor location in the situations where MouseGetPos() doesn't work. I'm using a Surface Pro 4 and have noticed that MouseGetPos() doesn't always update coordinates when using the pen instead of the mouse to control the cursor (but does on some windows). I read somewhere that the pen is not treated exactly the same as a mouse, so am not surprised by this behaviour. An script to demonstrate this behaviour with the SciTE4AutoIt3 editor and EDGE (or CHROME) running side by side: #include <GUIConstants.au3> HotKeySet("{ESC}", "Terminate") Global $mousex,$mousey Global $oldx = MouseGetPos(0) Global $oldy = MouseGetPos(1) Global $Form1 = GUICreate("Mouse Pos - ESC to exit", 197, 33, 400, 408, -1, BitOR($WS_EX_TOOLWINDOW,$WS_EX_TOPMOST)) Global $Label1 = GUICtrlCreateLabel("0,0", 0, 8, 196, 17, $SS_CENTER) GUISetState(@SW_SHOW) While 1 $mousex = MouseGetPos(0) $mousey = MouseGetPos(1) if $mousex<>$oldx or $mousey<>$oldy then $oldx=$mousex $oldy=$mousey GUICtrlSetData($label1, "") GUICtrlSetData($Label1, $mousex & ", " & $mousey) endif sleep(100) WEnd Func Terminate() Exit EndFunc Move the cursor using the mouse between windows and coordinates keep updating (Expected behaviour) Move the cursor using the pen between widows - cursor coordinates doesn't update when over the EDGE/CHROME window, but do when over SciTE4AutoIt3. This also happens with CHROME as well as both WORD and ONENOTE's document windows (updates on the toolbars etc, but not over the "page") …
- 3 replies
-
- mousegetpos()
- pen
-
(and 1 more)
Tagged with: