autohotkey - AutoHotKey - 按下鼠标滚轮时有选择地调用 AltTabMenu
问题描述
我目前使用以下脚本来使用鼠标滚轮切换应用程序:
MButton::AltTabMenu
WheelDown::AltTab
WheelUp::ShiftAltTab
这使我可以单击鼠标滚轮,然后滚动滚轮以选择所需的应用程序,然后再次单击以切换到它。
但是,有些应用程序需要我单击鼠标滚轮(即 SketchUp 才能进行轨道运行)。
仅当 SketchUp 应用程序位于前台时(即窗口具有焦点),我如何才能自动禁用/绕过这组宏?
根据官方文档,AltTabMenu 函数只有在直接与同一行的热键配对时才有效(即 MButton::AltTabMenu),所以我不能使用 WinGetTitle 和 IF 语句来选择性地调用 AltTabMenu。
目前,我在使用 SketchUp 时只是禁用了 AutoHotKey,但这很烦人,因为我的 AHK 脚本还包含我经常使用的其他几个快捷键/键重新映射。
感谢您的任何见解。
解决方案
总结出色的 AHK 社区已经提供的解决方案,这是我对这个问题的看法:
MButton::Send , ^!{tab} ; this sets wheel click to open the AltTab menu
#IfWinActive SketchUp ; you may need to adjust the window name here
MButton::return ; ignore the hotkey defined above if SketchUp is active
#IfWinActive ahk_class MultitaskingViewFrame ; Indicates that the alt-tab menu is present on the screen. The below hotkeys are used then to tab through the windows
WheelDown::Send, !{tab}
WheelUp::Send, +!{tab}
MButton::Send, {Enter}
#IfWinActive
推荐阅读
- microsoft-graph-api - MS Graph 中的 Beta Chats 端点给出 UnknownError
- bash - 如何查看带有字母的版本号?
- flutter - 尝试在 Raspberry pi 上安装 Flutter 时出错
- scala - 在桑格利亚酒 graphql 中面临订阅问题
- java - 使用JPA注释相互继承的抽象类的正确方法是什么?
- autodesk-forge - 查看器中的 IFC 几何图形不正确
- javascript - 如何使用 jQuery 或 JavaScript 从 html 输入的开头和结尾修剪特殊字符?
- python - 在列表中查找数字的第 n 位
- php - 在 PHP 中如何在同一台机器上找到 USB 设备的地址?
- python - Web2py - Oracle 连接失败