Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #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.
- ;You can change these however you like or add new ones if you like. All the info you need to do so is here:
- ;https://autohotkey.com/docs/KeyList.htm | https://autohotkey.com/docs/misc/Remap.htm | https://www.autohotkey.com/docs/Hotkeys.htm
- ;Check the config, and info section before you start the script.
- ;Make sure your numpad is enabled on the client. Also while this is active normal numpad buttons may not work on the host.
- ; --------------------------------------------------
- ;configs for the script
- ;Location of the bat file that starts the KillNvStreamer task. (Needed for Numpad9)
- KillNvStreamerFullPath=C:\Users\JacobMIX\Desktop\Stuff\Kill nvstramer\Run task - Kill nvstreamer.exe.bat
- ;KillNvStreamerFullPath=<Full_Path_To_KillNvStreamer_Bat_Task_Shortcut_Here>
- ;You can get the NvStreamer Killer bats from here: https://mega.nz/#F!fQ8kSAzL!b_QgzOeVxFFmhBleEZ4REg | Kill nvstramer.rar
- ;Your monitor resolutions. (Needed for Numpad6)
- leftMonitorWidth = 1920
- leftMonitorHeight = 1080
- rightMonitorWidth = 1920
- rightMonitorHeight = 1080
- ; --------------------------------------------------
- ;Info, and credits.
- ;For Numpad1
- ;Does "Left Windows key"
- ;For Numpad2
- ;Does "Left Alt" Nothing special. Be free to suggest something better on the Moonlight Discord.
- ;For Numpad3
- ;Set's current window to always on top. (Toggable)
- ;For Numpad4
- ;Does "Left Ctrl" Nothing special. Be free to suggest something better on the Moonlight Discord.
- ;For Numpad5
- ;Opens the Alt+Tab menu. Missing features, and is pretty buggy at times. A work in progress.
- ;For Numpad6
- ;Moves the active window from one monitor to the other. Similar to JumpWin.exe, but that stopped working for me for some reason.
- ;Based on Thalon's code at http://www.autohotkey.com/forum/topic19440.html [Jon Aquino 2008-09-17]
- ;For Numpad7
- ;Does "Ctrl+Shift+Esc" (Task Manager)
- ;For Numpad8
- ;Does "Prt Sc" (Take screenshot)
- ;For Numpad9
- ;Runs the bat file that runs the task that kills the stream.
- ;Check the config section before running this.
- ;To Disconect Moonlight normally from the client just "Shifr+Ctrl+Alt+Q" Tho the Numpad9 should also force the stream to close.
- ;Numpad0+Numpad1
- ;Ends this script.<
- ;The actual key shortcuts are below.
- ; --------------------------------------------------
- Numpad1::LWin ; Left Windows key
- ; --------------------------------------------------
- ;Numpad2::LAlt ; Left Alt
- ; --------------------------------------------------
- Numpad3::Winset, Alwaysontop, , A ; Set window to always on top. (Toggle)
- ; --------------------------------------------------
- Numpad4::LControl ; Left Ctrl
- ; --------------------------------------------------
- Numpad5::alttabandmenu
- #if winactive("ahk_class TaskSwitcherWnd")
- !Numpad5 up::send {Alt Up}
- !LButton:: ; Left mouse button. The ! prefix makes it fire while the Alt key is down (which it is if the alt-tab menu is visible).
- if WinExist("ahk_class #32771") ; Indicates that the alt-tab menu is present on the screen.
- sleep, 2000
- Send {Click}{Alt Up}{Numpad5 Up}
- sleep, 2000
- return
- Numpad5 & Numpad2::
- if WinExist("ahk_class #32771")
- Send {Blind}{Down}
- return
- Numpad5 & Numpad4::
- if WinExist("ahk_class #32771")
- Send {Blind}{Left}
- return
- Numpad5 & Numpad6::
- if WinExist("ahk_class #32771")
- Send {Blind}{Right}
- return
- Numpad5 & Numpad8::
- if WinExist("ahk_class #32771")
- Send {Blind}{Up}
- return
- ; --------------------------------------------------
- Numpad6:: ; Numpad6
- activeWindow := WinActive("A")
- if activeWindow = 0
- {
- return
- }
- WinGet, minMax, MinMax, ahk_id %activeWindow%
- if minMax = 1
- {
- WinRestore, ahk_id %activeWindow%
- }
- WinGetPos, x, y, width, height, ahk_id %activeWindow%
- if x < 0
- {
- xScale := rightMonitorWidth / leftMonitorWidth
- yScale := rightMonitorHeight / leftMonitorHeight
- x := leftMonitorWidth + x
- newX := x * xScale
- newY := y * yScale
- newWidth := width * xScale
- newHeight := height * yScale
- }
- else
- {
- xScale := leftMonitorWidth / rightMonitorWidth
- yScale := leftMonitorHeight / rightMonitorHeight
- newX := x * xScale
- newY := y * yScale
- newWidth := width * xScale
- newHeight := height * yScale
- newX := newX - leftMonitorWidth
- }
- WinMove, ahk_id %activeWindow%, , %newX%, %newY%, %newWidth%, %newHeight%
- if minMax = 1
- {
- WinMaximize, ahk_id %activeWindow%
- }
- WinActivate ahk_id %activeWindow% ;Needed - otherwise another window may overlap it
- return
- ; --------------------------------------------------
- Numpad7::<^<+Esc ; Ctrl Shift Esc (Task Manager)
- ; --------------------------------------------------
- Numpad8::PrintScreen ;Prt Sc (Take screenshot)
- ; --------------------------------------------------
- Numpad9::Run, "%KillNvStreamerFullPath%" ; Runs the bat file that runs the task that kills the stream.
- ; --------------------------------------------------
- Numpad0 & Numpad1::ExitApp ; Numpad0+Numpad1 will close this script. (Need to be on the last line)
Advertisement
Add Comment
Please, Sign In to add comment