2015-10-09 50 views
0

姿态重新绑定最近我一直在试图重新绑定我罗技无线触控板的三指手势在的Windows 10桌面之间进行切换。我使用的代码是如下:AHK:特定HID鼠标

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. 
; #Warn ; Enable warnings to assist with detecting common errors. 
SendMode Input ; Recommended for new scripts due to its superior speed and reliability. 
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. 
XButton1::SendInput {LCtrl down}{LWin down}{Right}{LCtrl up}{LWin up} 
XButton2::SendInput {LCtrl down}{LWin down}{Left}{LCtrl up}{LWin up} 
#F::Send {LWin down}{Tab}{LWin up} 

然而,当我按我的鼠标我用Browser_forward和Browser_Back,台式机之间的切换鼠标以及按钮。您是否可以强制AutoHotKey只使用触控板进行手势操作?如果是这样,怎么样?

回答

0

您有两种选择!

  1. 您可以激活您的热键排除某些窗口
  2. 让你的快捷键只在排除其他所有
  3. 某些Windows活动

您可以通过使用#IfWinActive#IfWinActive IfWinActiveWinGet,很多的选择上做到这一点功能和命令为此...

既然你提到的桌面,我很好奇如何检测如果桌面是活动的,下面是结果:

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. 
; #Warn ; Enable warnings to assist with detecting common errors. 
SendMode Input ; Recommended for new scripts due to its superior speed and reliability. 
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. 
$XButton1:: 
    If (IsDeskTopActive()) 
     SendInput {LCtrl down}{LWin down}{Right}{LCtrl up}{LWin up} 
    Else 
     SendInput {XButton1} 
Return 

$XButton2:: 
If (IsDeskTopActive()) 
    SendInput {LCtrl down}{LWin down}{Left}{LCtrl up}{LWin up} 
Else 
    SendInput {XButton2} 
return 

#F::Send {LWin down}{Tab}{LWin up} 

IsDesktopActive() { ; Modified.. orignal by HotKeyIt 
    MouseGetPos,,,win 
    WinGetClass, class, ahk_id %win% 
    If class in Progman,WorkerW 
     Return True 
    Return False 
}