Re: [AHK-] 請問有辦法抓到游標的座標,讓滑鼠可以 …

看板EzHotKey作者 (張昱珩)時間15年前 (2010/03/23 16:22), 編輯推噓2(200)
留言2則, 1人參與, 最新討論串1/1
The current X and Y coordinates of the caret (text insertion point). The coordinates are relative to the active window unless CoordMode is used to make them relative to the entire screen. If there is no active window or the caret position cannot be determined, these variables are blank. The following script allows you to move the caret around to see its current position displayed in an auto-update tooltip. Note that some windows (e.g. certain versions of MS Word) report the same caret position regardless of its actual position. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= #Persistent ; 讓程式持續執行 SetTimer, WatchCaret, 100 ; 每 0.1 秒執行一次 Label WatchCaret。 return ; 程式自動執行區段結束 WatchCaret: ; Label WatchCaret 開始 ToolTip, X%A_CaretX% Y%A_CaretY%, A_CaretX, A_CaretY - 20 ; A_CaretX 是 input caret (鍵盤輸入游標) 的 x 座標,類推 A_CaretY return ; Label WatchCaret 終止 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= If the contents of these variables are fetched repeatedly at a high frequency (i.e. every 500 ms or faster), the user's ability to double-click will probably be disrupted. There is no known workaround. 搭配 MouseMove 函數使用:http://tinyurl.com/y8rojk8 ※ 引述《notlo (notlo)》之銘言: : 請問有辦法抓到游標的座標,讓滑鼠可以移到該座標嗎?? : 如題.. : 研究了一會,都不曉的怎麼抓游標(是游標不是鼠標)的座標, : 不曉得有沒有鄉民可以指導一下的.. : 謝謝了.. -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.42.74.223

03/24 01:08, , 1F
這位高人,謝謝您的幫忙,但我實在看不太懂,能幫我注解一下嘛?
03/24 01:08, 1F
ctrl+alt+z 將滑鼠移到輸入游標 (但我測試後發現,在 firefox 中無效) -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= ^!z:: MouseMove, %A_CaretX%,%A_CaretY% return -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= ※ 編輯: IOann 來自: 123.192.91.167 (03/24 02:39)

03/24 18:03, , 2F
真是太謝謝你了,我弄出來了..
03/24 18:03, 2F
※ 編輯: IOann 來自: 211.21.127.209 (07/30 20:25)
文章代碼(AID): #1Bg7e__2 (EzHotKey)
文章代碼(AID): #1Bg7e__2 (EzHotKey)