如果Gui跟随鼠标指针自动热键,则鼠标左键单击不起作用

时间:2019-02-15 10:28:13

标签: autohotkey

如果Gui跟随鼠标指针自动热键,则单击鼠标不起作用。

我有一个Ahk脚本,可以使我的图形用户界面跟随鼠标指针。

但是鼠标左键不起作用。 (我可以单击/运行记事本,但不能在记事本中选择文本!)

我现在不为什么这样做呢? (Gui +图片不在鼠标指针上。)

gui follow mouse pointer

Follow-Pointer.ahk

#SingleInstance force 
CoordMode, Mouse, screen 
CoordMode, ToolTip, screen 
IfNotExist, c5sc29f.gif ;c5sc29f.gif File is roket.gif 
   URLDownloadToFile, https://i.imgur.com/c5sc29f.gif, c5sc29f.gif 
Gui -Caption +LastFound +ToolWindow +AlwaysOnTop 
Gui, Margin, 0, 0 
Gui, Color, FFFFFF 
Gui, Add, Picture, x100 y100 w-1 h50 +BackgroundTrans, c5sc29f.gif ;
;WinSet, Transcolor, FFFFFF 
WinSet, ExStyle, +0x20  ; set click through style 
gosub, F1 
return 

F1:: SetTimer Draw, % (switch:= !switch) ? "20" : "-20" 

Draw: 
   MouseGetPos, x, y 
   y+=10, x+=10 
   If switch {
      Gui Show, x%x% y%y% 
      ;~ ToolTip,%  "x" x " y" y,% x+0,% y+50
   } else {
      Gui Cancel 
      ToolTip,
   }
return 

esc::ExitApp 
ExitApp

return

1 个答案:

答案 0 :(得分:2)

尝试

Gui Show, x%x% y%y% NoActivate

NoActivate 避免停用当前活动的窗口。