Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- **************************************************************
- Elemeno's Keycloner for World of Warcraft [5 boxing edition]
- Current Version 12.06.15
- Feel free to use / modify this code as needed.
- I am distrubuting this free of charge, however, I would certainly
- apreciate donations to help me buy a couple of beers!
- https://www.paypal.me/lmno
- **************************************************************
- **************************************************************
- IMPORTANT STUFF
- To close the program use <CTRL>+<SHIFT>+C at anytime
- Press 'Pause' to temporarily suspend the program
- **************************************************************
- To Use:
- **************************************************************
- -Open up to 5 warcraft windows and login to your characters
- -Start the program
- -Pressing <Shift> and F1 will load Camera Setup #1 [Main Window left side, slaves right side]
- -Pressing <Shift> and F2 will load Camera Setup #2 [One window maximized]
- -Pressing F1 - F5 will change and focus a new main window
- -Pressing <Scroll Lock> will reload the script, use if something gets stuck or stops working
- -*note* program will automatically close if you type something when a WoW window is not in focus
- This is ON PURPOSE and will help prevent people from typing private messages or sensitive information
- to your WoW windows on accident.
- Special Warcraft Setup:
- **************************************************************
- This script works heavily dependant on certain macros you have
- set up with keybinds in your respective warcraft windows.
- Your two characters should be able to jump and activate the standard
- shortcut keys but will have a hard time getting around. You will need
- to set up some /follow macros, and their is no one *correct* way to do it.
- Search the web, forums, etc.. and you will have different people having their
- own preferences. I will provide a limited amount below to perform basic
- functions / tasks on your two characters.
- Basic Setup:
- **************************************************************
- For Wow Instance #1 [Your main character]
- - Unbind your arrow movement keys
- For WoW Instance #2 - #5 [Your slave characters]
- - Unbind your standard movement keys Q,W,E,A,S,D
- - Bind the movement keys to the arrow keys
- - Set up a macro / keybind to the letter 'G' to read the following:
- /follow nameofmaincharacter (where 'nameofmaincharacter' is the name of your main character)
- /target nameofmaincharacter
- /assist nameofmaincharacter
- /petfollow nameofmaincharacter [optional]
- The purpose of this is to allow your second characters to always follow
- your main, and your second characters will always target whatever your
- main is targeting at the time.
- If your main toon selects a new target and want your secondary toons target
- to get updated, just press 'G' again. I just prefer 'G'. You can make this
- whatever you want.
- The Basic setup will allow your secondary character to have a /follow and /target
- bound to one single key, and allow you to make minor running adjustments by way
- of the arrow keys. QWEASD control player #1, UP DOWN LEFT RIGHT arrow keys
- will control player #2 [they must be bound properly in your wow keybindings
- */
- ;***********************************************
- ;Start
- ;***********************************************
- #singleinstance force
- #MaxHotkeysPerInterval 500
- #NoEnv
- SetWorkingDir %A_ScriptDir%
- title=Elemeno's Multiboxing Keycloner
- windowstyle=1
- hotkey, ^+c, close
- onexit, close
- SetBatchLines, -1
- WinGet, wowid, List, World of Warcraft
- ;***********************************************
- ;Menu
- ;***********************************************
- Menu, tray, add, Window Style #1 [Main / Slaves], window1
- Menu, tray, add, Window Style #2 [Main Maximized], window2
- menu, tray, tip, %title%
- ;disable these if you want borders on your windows. You can disable a line by putting a ; in front of it.
- winset, style, -0xC00000 -0x800000 -0x40000, ahk_id %wowid1%
- winset, style, -0xC00000 -0x800000, ahk_id %wowid2%
- winset, style, -0xC00000 -0x800000, ahk_id %wowid3%
- winset, style, -0xC00000 -0x800000, ahk_id %wowid4%
- winset, style, -0xC00000 -0x800000, ahk_id %wowid5%
- ifwinexist , ahk_id %wowid1%
- {
- winactivate, ahk_id %wowid1%
- winrestore, ahk_id %wowid1%
- winmaximize, ahk_id %wowid1%
- }
- gosub alwaysontop_on
- WinGetPos, x1, y1, w1, h1, ahk_id %wowid1%
- x_win_1 := 0
- y_win_1 := 0
- w_win_1 := A_ScreenWidth * .80
- h_win_1 := A_ScreenHeight * .963
- x_win_2 := A_ScreenWidth * .80
- y_win_2 := 0
- w_win_2 := A_ScreenWidth * .20
- h_win_2 := (A_ScreenHeight * .963) * .25
- x_win_3 := A_ScreenWidth * .80
- y_win_3 := (A_ScreenHeight * .963) * .25
- w_win_3 := A_ScreenWidth * .20
- h_win_3 := (A_ScreenHeight * .963) * .25
- x_win_4 := A_ScreenWidth * .80
- y_win_4 := (A_ScreenHeight * .963) * .50
- w_win_4 := A_ScreenWidth * .20
- h_win_4 := (A_ScreenHeight * .963) * .25
- x_win_5 := A_ScreenWidth * .80
- y_win_5 := (A_ScreenHeight * .963) * .75
- w_win_5 := A_ScreenWidth * .20
- h_win_5 := (A_ScreenHeight * .963) * .25
- gosub windowstart
- ;***********************************************
- ;Pause and Scrolllock hotkeys
- ;***********************************************
- ~Pause::
- Suspend, Toggle
- if A_IsSuspended = 1
- {
- coordmode, tooltip, screen
- ToolTip, %title% Suspended, (A_ScreenWidth * .45), (A_ScreenHeight * .85), 1
- TrayTip, %title%, SUSPENDED, 1, 1
- soundplay, *63
- }
- if A_IsSuspended = 0
- {
- ToolTip, , 0, 0, 1
- TrayTip, Elemeno's Dual Boxing Keycloner, RUNNING, 1, 1
- soundplay, *64
- }
- Return
- ~ScrollLock::
- Reload
- Return
- ;***********************************************
- ;Change the main focus window
- ;***********************************************
- windowstart:
- ~F1:: ; Brings Window 1 to the main screen
- window1=ahk_id %wowid1%
- window2=ahk_id %wowid2%
- window3=ahk_id %wowid3%
- window4=ahk_id %wowid4%
- window5=ahk_id %wowid5%
- gosub changewindows
- winactivate ahk_id %wowid1%
- return
- ~F2:: ; Brings Window 2 to the main screen
- window1=ahk_id %wowid2%
- window2=ahk_id %wowid1%
- window3=ahk_id %wowid3%
- window4=ahk_id %wowid4%
- window5=ahk_id %wowid5%
- gosub changewindows
- winactivate ahk_id %wowid2%
- return
- ~F3:: ; Brings Window 2 to the main screen
- window1=ahk_id %wowid3%
- window2=ahk_id %wowid1%
- window3=ahk_id %wowid2%
- window4=ahk_id %wowid4%
- window5=ahk_id %wowid5%
- gosub changewindows
- winactivate ahk_id %wowid3%
- return
- ~F4:: ; Brings Window 2 to the main screen
- window1=ahk_id %wowid4%
- window2=ahk_id %wowid1%
- window3=ahk_id %wowid2%
- window4=ahk_id %wowid3%
- window5=ahk_id %wowid5%
- gosub changewindows
- winactivate ahk_id %wowid4%
- return
- ~F5:: ; Brings Window 2 to the main screen
- window1=ahk_id %wowid5%
- window2=ahk_id %wowid1%
- window3=ahk_id %wowid2%
- window4=ahk_id %wowid3%
- window5=ahk_id %wowid4%
- gosub changewindows
- winactivate ahk_id %wowid5%
- return
- ;***********************************************
- ;Swap the main windows based on main focus choice
- ;***********************************************
- changewindows:
- if windowstyle=1
- {
- winmove, %window1%, ,%x_win_1%, %y_win_1%, %w_win_1%, %h_win_1%
- winmove, %window2%, ,%x_win_2%, %y_win_2%, %w_win_2%, %h_win_2%
- winmove, %window3%, ,%x_win_3%, %y_win_3%, %w_win_3%, %h_win_3%
- winmove, %window4%, ,%x_win_4%, %y_win_4%, %w_win_4%, %h_win_4%
- winmove, %window5%, ,%x_win_5%, %y_win_5%, %w_win_5%, %h_win_5%
- }
- if windowstyle=2
- {
- winmove, %window1%, ,x1, y1, w1, h1
- winmove, %window2%, ,x1, y1, w1, h1
- winmove, %window3%, ,x1, y1, w1, h1
- winmove, %window4%, ,x1, y1, w1, h1
- winmove, %window5%, ,x1, y1, w1, h1
- winrestore, %window1%
- }
- return
- ;***********************************************
- ;Load the different window profiles
- ;***********************************************
- window1:
- ~+F1:: ; Loads standard window profile
- windowstyle = 1
- gosub, windowstart
- Return
- window2:
- ~+F2:: ; Forces main window to fullscreen
- windowstyle = 2
- gosub windowstart
- winmove, %window1%, ,x1, y1, w1, h1
- Return
- ;***********************************************
- ;Standard Keyboard keys
- ;***********************************************
- ~1::
- ~2::
- ~3::
- ~4::
- ~5::
- ~6::
- ~7::
- ~8::
- ~9::
- ~0::
- ~-::
- ~=::
- ~q::
- ~w::
- ~e::
- ~r::
- ~t::
- ~y::
- ~u::
- ~i::
- ~o::
- ~p::
- ~[::
- ~]::
- ~a::
- ~s::
- ~d::
- ~f::
- ~g::
- ~h::
- ~j::
- ~k::
- ~l::
- ;~;::
- ~'::
- ~z::
- ~x::
- ~c::
- ~v::
- ~b::
- ~n::
- ~m::
- ~,::
- ~.::
- ~`::
- ~/::
- IfWinActive, ahk_id %wowid1%
- {
- StringTrimLeft, ThisKey, A_ThisHotKey, 1
- ControlSend,, %ThisKey%, ahk_id %wowid2%
- ControlSend,, %ThisKey%, ahk_id %wowid3%
- ControlSend,, %ThisKey%, ahk_id %wowid4%
- ControlSend,, %ThisKey%, ahk_id %wowid5%
- Return
- }
- IfWinActive, ahk_id %wowid2%
- {
- StringTrimLeft, ThisKey, A_ThisHotKey, 1
- ControlSend,, %ThisKey%, ahk_id %wowid1%
- ControlSend,, %ThisKey%, ahk_id %wowid3%
- ControlSend,, %ThisKey%, ahk_id %wowid4%
- ControlSend,, %ThisKey%, ahk_id %wowid5%
- Return
- }
- IfWinActive, ahk_id %wowid3%
- {
- StringTrimLeft, ThisKey, A_ThisHotKey, 1
- ControlSend,, %ThisKey%, ahk_id %wowid1%
- ControlSend,, %ThisKey%, ahk_id %wowid2%
- ControlSend,, %ThisKey%, ahk_id %wowid4%
- ControlSend,, %ThisKey%, ahk_id %wowid5%
- Return
- }
- IfWinActive, ahk_id %wowid4%
- {
- StringTrimLeft, ThisKey, A_ThisHotKey, 1
- ControlSend,, %ThisKey%, ahk_id %wowid1%
- ControlSend,, %ThisKey%, ahk_id %wowid2%
- ControlSend,, %ThisKey%, ahk_id %wowid3%
- ControlSend,, %ThisKey%, ahk_id %wowid5%
- Return
- }
- IfWinActive, ahk_id %wowid5%
- {
- StringTrimLeft, ThisKey, A_ThisHotKey, 1
- ControlSend,, %ThisKey%, ahk_id %wowid1%
- ControlSend,, %ThisKey%, ahk_id %wowid2%
- ControlSend,, %ThisKey%, ahk_id %wowid3%
- ControlSend,, %ThisKey%, ahk_id %wowid4%
- Return
- }
- ;***********************************************
- ;Shift + Standard Keyboard keys
- ;***********************************************
- ~+1::
- ~+2::
- ~+3::
- ~+4::
- ~+5::
- ~+6::
- ~+7::
- ~+8::
- ~+9::
- ~+0::
- ~+-::
- ~+=::
- ~+q::
- ~+w::
- ~+e::
- ~+r::
- ~+t::
- ~+y::
- ~+u::
- ~+i::
- ~+o::
- ~+p::
- ~+[::
- ~+]::
- ~+a::
- ~+s::
- ~+d::
- ~+f::
- ~+g::
- ~+h::
- ~+j::
- ~+k::
- ~+l::
- ;~+;::
- ~+'::
- ~+z::
- ~+x::
- ~+c::
- ~+v::
- ~+b::
- ~+n::
- ~+m::
- ~+,::
- ~+.::
- ~+`::
- ~+/::
- IfWinActive, ahk_id %wowid1%
- {
- StringTrimLeft, ThisKey, A_ThisHotKey, 1
- ControlSend,, {shift down}%thiskey%{shift up}, ahk_id %wowid2%
- ControlSend,, {shift down}%thiskey%{shift up}, ahk_id %wowid3%
- ControlSend,, {shift down}%thiskey%{shift up}, ahk_id %wowid4%
- ControlSend,, {shift down}%thiskey%{shift up}, ahk_id %wowid5%
- Return
- }
- IfWinActive, ahk_id %wowid2%
- {
- StringTrimLeft, ThisKey, A_ThisHotKey, 1
- ControlSend,, {shift down}%thiskey%{shift up}, ahk_id %wowid1%
- ControlSend,, {shift down}%thiskey%{shift up}, ahk_id %wowid3%
- ControlSend,, {shift down}%thiskey%{shift up}, ahk_id %wowid4%
- ControlSend,, {shift down}%thiskey%{shift up}, ahk_id %wowid5%
- Return
- }
- IfWinActive, ahk_id %wowid3%
- {
- StringTrimLeft, ThisKey, A_ThisHotKey, 1
- ControlSend,, {shift down}%thiskey%{shift up}, ahk_id %wowid1%
- ControlSend,, {shift down}%thiskey%{shift up}, ahk_id %wowid2%
- ControlSend,, {shift down}%thiskey%{shift up}, ahk_id %wowid4%
- ControlSend,, {shift down}%thiskey%{shift up}, ahk_id %wowid5%
- Return
- }
- IfWinActive, ahk_id %wowid4%
- {
- StringTrimLeft, ThisKey, A_ThisHotKey, 1
- ControlSend,, {shift down}%thiskey%{shift up}, ahk_id %wowid1%
- ControlSend,, {shift down}%thiskey%{shift up}, ahk_id %wowid2%
- ControlSend,, {shift down}%thiskey%{shift up}, ahk_id %wowid3%
- ControlSend,, {shift down}%thiskey%{shift up}, ahk_id %wowid5%
- Return
- }
- IfWinActive, ahk_id %wowid5%
- {
- StringTrimLeft, ThisKey, A_ThisHotKey, 1
- ControlSend,, {shift down}%thiskey%{shift up}, ahk_id %wowid1%
- ControlSend,, {shift down}%thiskey%{shift up}, ahk_id %wowid2%
- ControlSend,, {shift down}%thiskey%{shift up}, ahk_id %wowid3%
- ControlSend,, {shift down}%thiskey%{shift up}, ahk_id %wowid4%
- Return
- }
- ;***********************************************
- ;Control + Standard Keyboard keys
- ;***********************************************
- ~^1::
- ~^2::
- ~^3::
- ~^4::
- ~^5::
- ~^6::
- ~^7::
- ~^8::
- ~^9::
- ~^0::
- ~^-::
- ~^=::
- ~^q::
- ~^w::
- ~^e::
- ~^r::
- ~^t::
- ~^y::
- ~^u::
- ~^i::
- ~^o::
- ~^p::
- ~^[::
- ~^]::
- ~^a::
- ~^s::
- ~^d::
- ~^f::
- ~^g::
- ~^h::
- ~^j::
- ~^k::
- ~^l::
- ;~^;::
- ~^'::
- ~^z::
- ~^x::
- ~^c::
- ~^v::
- ~^b::
- ~^n::
- ~^m::
- ~^,::
- ~^.::
- ~^`::
- ~^/::
- IfWinActive, ahk_id %wowid1%
- {
- StringTrimLeft, ThisKey, A_ThisHotKey, 1
- ControlSend,, {control down}%thiskey%{control up}, ahk_id %wowid2%
- ControlSend,, {control down}%thiskey%{control up}, ahk_id %wowid3%
- ControlSend,, {control down}%thiskey%{control up}, ahk_id %wowid4%
- ControlSend,, {control down}%thiskey%{control up}, ahk_id %wowid5%
- Return
- }
- IfWinActive, ahk_id %wowid2%
- {
- StringTrimLeft, ThisKey, A_ThisHotKey, 1
- ControlSend,, {control down}%thiskey%{control up}, ahk_id %wowid1%
- ControlSend,, {control down}%thiskey%{control up}, ahk_id %wowid3%
- ControlSend,, {control down}%thiskey%{control up}, ahk_id %wowid4%
- ControlSend,, {control down}%thiskey%{control up}, ahk_id %wowid5%
- Return
- }
- IfWinActive, ahk_id %wowid3%
- {
- StringTrimLeft, ThisKey, A_ThisHotKey, 1
- ControlSend,, {control down}%thiskey%{control up}, ahk_id %wowid1%
- ControlSend,, {control down}%thiskey%{control up}, ahk_id %wowid2%
- ControlSend,, {control down}%thiskey%{control up}, ahk_id %wowid4%
- ControlSend,, {control down}%thiskey%{control up}, ahk_id %wowid5%
- Return
- }
- IfWinActive, ahk_id %wowid4%
- {
- StringTrimLeft, ThisKey, A_ThisHotKey, 1
- ControlSend,, {control down}%thiskey%{control up}, ahk_id %wowid1%
- ControlSend,, {control down}%thiskey%{control up}, ahk_id %wowid2%
- ControlSend,, {control down}%thiskey%{control up}, ahk_id %wowid3%
- ControlSend,, {control down}%thiskey%{control up}, ahk_id %wowid5%
- Return
- }
- IfWinActive, ahk_id %wowid5%
- {
- StringTrimLeft, ThisKey, A_ThisHotKey, 1
- ControlSend,, {control down}%thiskey%{control up}, ahk_id %wowid1%
- ControlSend,, {control down}%thiskey%{control up}, ahk_id %wowid2%
- ControlSend,, {control down}%thiskey%{control up}, ahk_id %wowid3%
- ControlSend,, {control down}%thiskey%{control up}, ahk_id %wowid4%
- Return
- }
- ;***********************************************
- ;Start of Special Hotkeys
- ;***********************************************
- ~Enter::
- hotkey=enter
- gosub hotkeypress
- return
- ~Tab::
- hotkey=Tab
- gosub hotkeypress
- return
- ~Delete::
- hotkey=Delete
- gosub hotkeypress
- return
- ~BackSpace::
- hotkey=Backspace
- gosub hotkeypress
- return
- ~Escape::
- hotkey=Escape
- gosub hotkeypress
- return
- ~Numpad0::
- hotkey=Numpad0
- gosub hotkeypress
- return
- ~Numpad1::
- hotkey=Numpad1
- gosub hotkeypress
- return
- ~Numpad2::
- hotkey=Numpad2
- gosub hotkeypress
- return
- ~Numpad3::
- hotkey=Numpad3
- gosub hotkeypress
- return
- ~Numpad4::
- hotkey=Numpad4
- gosub hotkeypress
- return
- ~Numpad5::
- hotkey=Numpad5
- gosub hotkeypress
- return
- ~Numpad6::
- hotkey=Numpad6
- gosub hotkeypress
- return
- ~Numpad7::
- hotkey=Numpad7
- gosub hotkeypress
- return
- ~Numpad8::
- hotkey=Numpad8
- gosub hotkeypress
- return
- ~Numpad9::
- hotkey=Numpad9
- gosub hotkeypress
- return
- ~NumpadSub::
- hotkey=NumpadSub
- gosub hotkeypress
- return
- ~NumpadAdd::
- hotkey=NumpadAdd
- gosub hotkeypress
- return
- ~NumpadEnter::
- hotkey=NumpadEnter
- gosub hotkeypress
- return
- ~NumpadDot::
- hotkey=NumpadDot
- gosub hotkeypress
- return
- ~NumpadDiv::
- hotkey=NumpadDiv
- gosub hotkeypress
- return
- ~NumpadMult::
- hotkey=NumpadMult
- gosub hotkeypress
- return
- ~Up::
- hotkey=Up
- gosub hotkeypress1
- return
- ~Down::
- hotkey=down
- gosub hotkeypress1
- return
- ~Left::
- hotkey=Left
- gosub hotkeypress1
- return
- ~Right::
- hotkey=right
- gosub hotkeypress1
- return
- ~Space::
- hotkey=space
- gosub hotkeypress1
- return
- ;***********************************************
- ;Hotkey subroutine for standard buttons
- ;***********************************************
- hotkeypress:
- ifwinactive, ahk_id %wowid1%
- {
- ControlSend,, {%hotkey%}, ahk_id %wowid2%
- ControlSend,, {%hotkey%}, ahk_id %wowid3%
- ControlSend,, {%hotkey%}, ahk_id %wowid4%
- ControlSend,, {%hotkey%}, ahk_id %wowid5%
- }
- ifwinactive, ahk_id %wowid2%
- {
- ControlSend,, {%hotkey%}, ahk_id %wowid1%
- ControlSend,, {%hotkey%}, ahk_id %wowid3%
- ControlSend,, {%hotkey%}, ahk_id %wowid4%
- ControlSend,, {%hotkey%}, ahk_id %wowid5%
- }
- ifwinactive, ahk_id %wowid3%
- {
- ControlSend,, {%hotkey%}, ahk_id %wowid1%
- ControlSend,, {%hotkey%}, ahk_id %wowid2%
- ControlSend,, {%hotkey%}, ahk_id %wowid4%
- ControlSend,, {%hotkey%}, ahk_id %wowid5%
- }
- ifwinactive, ahk_id %wowid4%
- {
- ControlSend,, {%hotkey%}, ahk_id %wowid1%
- ControlSend,, {%hotkey%}, ahk_id %wowid2%
- ControlSend,, {%hotkey%}, ahk_id %wowid3%
- ControlSend,, {%hotkey%}, ahk_id %wowid5%
- }
- ifwinactive, ahk_id %wowid5%
- {
- ControlSend,, {%hotkey%}, ahk_id %wowid1%
- ControlSend,, {%hotkey%}, ahk_id %wowid2%
- ControlSend,, {%hotkey%}, ahk_id %wowid3%
- ControlSend,, {%hotkey%}, ahk_id %wowid4%
- }
- return
- ;***********************************************
- ;Hotkey subroutine for special buttons
- ;***********************************************
- hotkeypress1:
- IfWinActive, ahk_id %wowid1%
- {
- ControlSend,, {%hotkey% down}, ahk_id %wowid2%
- ControlSend,, {%hotkey% down}, ahk_id %wowid3%
- ControlSend,, {%hotkey% down}, ahk_id %wowid4%
- ControlSend,, {%hotkey% down}, ahk_id %wowid5%
- loop
- {
- getkeystate, state, %hotkey%
- if state = U
- break
- }
- ControlSend,, {%hotkey% up}, ahk_id %wowid2%
- ControlSend,, {%hotkey% up}, ahk_id %wowid3%
- ControlSend,, {%hotkey% up}, ahk_id %wowid4%
- ControlSend,, {%hotkey% up}, ahk_id %wowid5%
- Return
- }
- IfWinActive, ahk_id %wowid2%
- {
- ControlSend,, {%hotkey% down}, ahk_id %wowid1%
- ControlSend,, {%hotkey% down}, ahk_id %wowid3%
- ControlSend,, {%hotkey% down}, ahk_id %wowid4%
- ControlSend,, {%hotkey% down}, ahk_id %wowid5%
- loop
- {
- getkeystate, state, %hotkey%
- if state = U
- break
- }
- ControlSend,, {%hotkey% up}, ahk_id %wowid1%
- ControlSend,, {%hotkey% up}, ahk_id %wowid3%
- ControlSend,, {%hotkey% up}, ahk_id %wowid4%
- ControlSend,, {%hotkey% up}, ahk_id %wowid5%
- Return
- }
- IfWinActive, ahk_id %wowid3%
- {
- ControlSend,, {%hotkey% down}, ahk_id %wowid1%
- ControlSend,, {%hotkey% down}, ahk_id %wowid2%
- ControlSend,, {%hotkey% down}, ahk_id %wowid4%
- ControlSend,, {%hotkey% down}, ahk_id %wowid5%
- loop
- {
- getkeystate, state, %hotkey%
- if state = U
- break
- }
- ControlSend,, {%hotkey% up}, ahk_id %wowid1%
- ControlSend,, {%hotkey% up}, ahk_id %wowid2%
- ControlSend,, {%hotkey% up}, ahk_id %wowid4%
- ControlSend,, {%hotkey% up}, ahk_id %wowid5%
- Return
- }
- IfWinActive, ahk_id %wowid4%
- {
- ControlSend,, {%hotkey% down}, ahk_id %wowid1%
- ControlSend,, {%hotkey% down}, ahk_id %wowid2%
- ControlSend,, {%hotkey% down}, ahk_id %wowid3%
- ControlSend,, {%hotkey% down}, ahk_id %wowid5%
- loop
- {
- getkeystate, state, %hotkey%
- if state = U
- break
- }
- ControlSend,, {%hotkey% up}, ahk_id %wowid1%
- ControlSend,, {%hotkey% up}, ahk_id %wowid2%
- ControlSend,, {%hotkey% up}, ahk_id %wowid3%
- ControlSend,, {%hotkey% up}, ahk_id %wowid5%
- Return
- }
- IfWinActive, ahk_id %wowid5%
- {
- ControlSend,, {%hotkey% down}, ahk_id %wowid1%
- ControlSend,, {%hotkey% down}, ahk_id %wowid2%
- ControlSend,, {%hotkey% down}, ahk_id %wowid3%
- ControlSend,, {%hotkey% down}, ahk_id %wowid4%
- loop
- {
- getkeystate, state, %hotkey%
- if state = U
- break
- }
- ControlSend,, {%hotkey% up}, ahk_id %wowid1%
- ControlSend,, {%hotkey% up}, ahk_id %wowid2%
- ControlSend,, {%hotkey% up}, ahk_id %wowid3%
- ControlSend,, {%hotkey% up}, ahk_id %wowid4%
- Return
- }
- ;***********************************************
- ;Closing the program
- ;***********************************************
- close:
- winset, alwaysontop, off, ahk_id %wowid1%
- winset, alwaysontop, off, ahk_id %wowid2%
- winset, alwaysontop, off, ahk_id %wowid3%
- winset, alwaysontop, off, ahk_id %wowid4%
- winset, alwaysontop, off, ahk_id %wowid5%
- winset, style, +0xC00000 +0x800000, ahk_id %wowid1%
- winset, style, +0xC00000 +0x800000, ahk_id %wowid2%
- winset, style, +0xC00000 +0x800000, ahk_id %wowid3%
- winset, style, +0xC00000 +0x800000, ahk_id %wowid4%
- winset, style, +0xC00000 +0x800000, ahk_id %wowid5%
- winrestore, ahk_id %wowid1%
- winrestore, ahk_id %wowid2%
- winrestore, ahk_id %wowid3%
- winrestore, ahk_id %wowid4%
- winrestore, ahk_id %wowid5%
- exitapp
- ;***********************************************
- ;Force windows to stay in foreground
- ;***********************************************
- alwaysontop_on:
- winset, alwaysontop, on, ahk_id %wowid1%
- winset, alwaysontop, on, ahk_id %wowid2%
- winset, alwaysontop, on, ahk_id %wowid3%
- winset, alwaysontop, on, ahk_id %wowid4%
- winset, alwaysontop, on, ahk_id %wowid5%
- return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement