ahk_scripts/myhotkeys.ahk

40 lines
981 B
AutoHotkey
Raw Permalink Normal View History

2021-11-28 18:02:16 +02:00
; Just a collection of useful hotkeys to have around
; Primarily to resize windows for the games that don't let you set window resolution
#NoEnv
#Warn
SendMode Input
; Not only windows titlebar and borders count towards window size
; shadow also does, so compensate for that, width 16, height 39
ResizeWin(Width = 0,Height = 0,ExtraW = 0,ExtraH = 0,WinW = 16,WinH = 39) {
WinGetPos,X,Y,W,H,A
if (Width == 0) {
Width := W
} else {
Width += ExtraW + WinW
}
if (Height == 0) {
Height := H
} else {
Height += ExtraH + WinH
}
WinMove,A,,%X%,%Y%,%Width%,%Height%
}
2021-11-28 18:02:16 +02:00
; always on top
#!t::Winset, Alwaysontop, , A
; usage: ResizeWin(Width,Height,ExtraW,ExtraH,WinW,WinH)
#!y::ResizeWin(1280,720)
#!u::ResizeWin(1920,1080)
2022-02-14 22:40:55 +02:00
; Horizon: Zero Dawn adds some extra pixels for no reason
2021-11-28 18:02:16 +02:00
;#!i::ResizeWin(1920,1080,8,8)
2022-02-14 22:40:55 +02:00
; Use right alt to change the keyboard layout
RAlt::Send #{Space}
LControl & Ralt::Send #{Space}