Autohotkey 自动热键-如何检测鼠标光标是否变为文本光标?

Autohotkey 自动热键-如何检测鼠标光标是否变为文本光标?,autohotkey,Autohotkey,我想知道鼠标光标是否已更改为文本光标,并为其激活新操作 代码如下: #IfWinActive, ahk_exe chrome.exe /* I want to put the if statement here; if not text cursor then the following would be activated */ Left:: { SendInput, ^+{Tab} ; Navigate one tab back in chrome } return Right::

我想知道鼠标光标是否已更改为文本光标,并为其激活新操作

代码如下:

#IfWinActive, ahk_exe chrome.exe

/* I want to put the if statement here; if not text cursor then the following would be activated */

Left::
{
  SendInput, ^+{Tab} ; Navigate one tab back in chrome
}
return

Right::
{
  SendInput, ^{Tab} ; Navigate one tab forward in chrome
}
return

/* End of the if statement */

#IfWinActive

万分感谢

这是一个内置变量

A_光标
-

在您的情况下,您最有可能感兴趣的是检查它是否存储了
IBeam

例如:

#If WinActive("ahk_exe chrome.exe") and (A_Cursor != "IBeam")
Left::
    SendInput, ^+{Tab} ; Navigate one tab back in chrome
return
(...)

旁注,如上所述,定义热键时不需要括号。

有内置变量

A_光标
-

在您的情况下,您最有可能感兴趣的是检查它是否存储了
IBeam

例如:

#If WinActive("ahk_exe chrome.exe") and (A_Cursor != "IBeam")
Left::
    SendInput, ^+{Tab} ; Navigate one tab back in chrome
return
(...)
请注意,如上所述,在定义热键时不使用括号