2016-12-26 134 views
1

我的目標是讓我的鼠標按鍵額外充當ALT標籤,所以我可以通過我的標籤滾動,而無需使用鍵盤。AHK鍵重新映射ALT標籤

XButton1::Alt 

LButton:: 
    If (GetKeyState("XButton1", "P")) 
     Send {TAB down} 

LButton Up:: 
    If (GetKeyState("XButton1", "P")) 
     Send {TAB up} 

我希望這所要做的就是當我拿着XButton1(我的鼠標返回按鈕),我可以點擊,它會作爲一個標籤,只有當我拿着XButton1否則我的點擊將作爲點擊

回答

0
; AltTab-replacement for Windows 8: 

XButton1 & LButton:: 
list = "" 
WinGet, id, list 
Loop, %id% 
{ 
    this_ID := id%A_Index% 
    WinGet, exStyle, exStyle, ahk_id %this_ID% 
    If !(exStyle & 0x100) 
     continue 
    IfWinActive, ahk_id %this_ID% 
     continue 
    WinGetTitle, title, ahk_id %this_ID% 
    If (title = "") 
     continue 
    WinActivate, ahk_id %this_ID% 
     break 
} 
return 


; AltTabMenu-replacement for Windows 8: 

XButton1 & RButton:: 
list = "" 
Menu, windows, Add 
Menu, windows, deleteAll 
WinGet, id, list 
Loop, %id% 
{ 
    this_ID := id%A_Index% 
    WinGet, exStyle, exStyle, ahk_id %this_ID% 
    If !(exStyle & 0x100) 
      continue 
    WinGetTitle, title, ahk_id %this_ID% 
    If (title = "") 
      continue 
    WinGetClass, class, ahk_id %this_ID% 
    If (class = "") 
      continue 
    If (class = "ApplicationFrameWindow") 
      continue   
    Menu, windows, Add, %title%%A_Tab%ahk_class %class%, ActivateWindow 
    WinGet, Path, ProcessPath, ahk_id %this_ID% 
    Menu, windows, Icon, %title%%A_Tab%ahk_class %class%, %Path%,, 0 
} 
Menu, windows, Show 
return 

ActivateWindow: 
WinActivate, %A_ThisMenuItem% 
return 

XButton1::Send {XButton1} 
1

試試這個:

XButton1::Send {XButton1} ; If you remove this line XButton1 loses its original/native function 

; Hold down XButton1 and press LButton to navigate the alt-tab menu: 
XButton1 & LButton::AltTab ; XButton1 becomes a prefix key 

https://autohotkey.com/docs/Hotkeys.htm#combo

https://autohotkey.com/docs/Hotkeys.htm#AltTabDetail

+0

我不得不放棄這個爲ALT標籤不AHK工作,贏得8非常好。 –

+0

看到我的第二個答案。 – user3419297