Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
AutoHotkey 是否有条件判断当前是否有任何文本字段(或 Word 文档、浏览器搜索栏、启用文本输入的任何内容)处于焦点状态?我想在可能的情况下使用一些热键来输入 Unicode 字符,并在可能的情况下执行其他操作。
这是一个获取当前焦点控件名称的简单示例。
F1:: ControlGetFocus, OutputVar, A if ErrorLevel MsgBox, The target window doesn't exist or none of its controls has input focus. else MsgBox, Control with focus = %OutputVar%
这适用于很多窗口,但总而言之,应用程序使用什么类型的控件来决定是否返回值很重要。