【问题标题】:AHK key remapping alt tabAHK 键重新映射 alt 选项卡
【发布时间】:2016-12-26 01:46:17
【问题描述】:

我的目标是让我的鼠标额外按钮充当 alt 选项卡,这样我就可以在不使用键盘的情况下滚动浏览我的选项卡。

XButton1::Alt

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

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

我希望这样做是,当我按住 XButton1(鼠标上的后退按钮)时,我可以单击它,它会充当一个选项卡,只有当我按住 XButton1 时,否则我的点击会充当一个选项卡点击

【问题讨论】:

    标签: autohotkey


    【解决方案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

    【讨论】:

    • 我不得不放弃这个,因为 alt 选项卡不适用于 ahk 并且很好地赢了 8。
    • 看我的第二个答案。
    【解决方案2】:
    ; 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}
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-12-09
      • 1970-01-01
      • 2015-05-01
      • 2018-12-15
      • 2015-11-15
      • 1970-01-01
      • 2014-05-10
      • 2016-02-21
      相关资源
      最近更新 更多