#IfWinActive is disabling the MButton hotkey

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
drago06
Posts: 1
Joined: 15 Aug 2017, 10:28

#IfWinActive is disabling the MButton hotkey

15 Aug 2017, 11:29

Code: Select all

#InstallKeybdHook
#NoEnv
#Persistent

Menu, Tray, Standard
Menu, Tray, Add
Menu, Tray, Add, None, none
Menu, Tray, Add, Single, single
Menu, Tray, Add, Double, double
Menu, Tray, Add, Triple, triple
Menu, Tray, Add, Firefox, firefox
Menu, Tray, Check, None
return




single:
Menu, Tray, Check, Single
Menu, Tray, UnCheck, Double
Menu, Tray, UnCheck, Triple
Menu, Tray, UnCheck, Firefox
Menu, Tray, UnCheck, None
Hotkey, MButton, d, Off
Hotkey, MButton, t, Off
Hotkey, MButton, f, Off
Hotkey, MButton, s, On
return

double:
Menu, Tray, Check, Double
Menu, Tray, UnCheck, Single
Menu, Tray, UnCheck, Triple
Menu, Tray, UnCheck, Firefox
Menu, Tray, UnCheck, None
Hotkey, MButton, s, Off
Hotkey, MButton, t, Off
Hotkey, MButton, f, Off
Hotkey, MButton, d, On
return

triple:
Menu, Tray, Check, Triple
Menu, Tray, UnCheck, Single
Menu, Tray, UnCheck, Double
Menu, Tray, UnCheck, Firefox
Menu, Tray, UnCheck, None
Hotkey, MButton, s, Off
Hotkey, MButton, d, Off
Hotkey, MButton, f, Off
Hotkey, MButton, t, On
return

firefox:
Menu, Tray, Check, Firefox
Menu, Tray, UnCheck, Single
Menu, Tray, UnCheck, Double
Menu, Tray, UnCheck, Triple
Menu, Tray, UnCheck, None
Hotkey, MButton, s, Off
Hotkey, MButton, d, Off
Hotkey, MButton, t, Off
Hotkey, MButton, f, On
return

none:
Menu, Tray, Check, None
Menu, Tray, UnCheck, Single
Menu, Tray, UnCheck, Double
Menu, Tray, UnCheck, Triple
Menu, Tray, UnCheck, Firefox
Hotkey, MButton, s, Off
Hotkey, MButton, d, Off
Hotkey, MButton, t, Off
Hotkey, MButton, f, Off
return

s:
Send {Alt down}{Tab down}{Tab up}{Alt up}
return

d:
Send {Alt down}{Tab down}{Tab up}{Tab down}{Tab up}{Alt up}
return

t:
Send {Alt down}{Tab down}{Tab up}{Tab down}{Tab up}{Tab down}{Tab up}{Alt up}
return

f:
Focus("firefox.exe")
return

Focus(proc)
{
  SetTitleMatchMode,2
  DetectHiddenWindows, Off
  IfWinNotActive, ahk_exe %proc%
  {
    IfWinExist, ahk_exe %proc%
    {
      WinGet, winid, ID, ahk_exe %proc%
      DllCall("SwitchToThisWindow", "UInt", winid, "UInt", 1)
      IfWinNotActive, ahk_exe firefox.exe
      {
        Send {Alt Down}
        Loop, 10
        {
          Send {Tab}
          IfWinActive, ahk_exe firefox.exe
            break
        }
        Send {Alt Up}
      }
    }
  }
  Return
}



#IfWinActive, ahk_exe cmd.exe
^SPACE::  Winset, Alwaysontop, , A

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: CrowexBR and 272 guests