summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVon Random <von@vdrandom.org>2021-11-28 19:02:16 +0300
committerVon Random <von@vdrandom.org>2021-11-28 19:02:16 +0300
commit21404a7e2f9073a17d4d0c4e5ccba2ddd1aeef3e (patch)
tree14f213df75d6586f891c7dcd177e066781864c1f
parentb39ce69537e91ff74413726e875ce347d854875f (diff)
initial commit
-rw-r--r--_winresize.ahk24
-rw-r--r--myhotkeys.ahk18
2 files changed, 42 insertions, 0 deletions
diff --git a/_winresize.ahk b/_winresize.ahk
new file mode 100644
index 0000000..14389f3
--- /dev/null
+++ b/_winresize.ahk
@@ -0,0 +1,24 @@
+#NoEnv
+#Warn
+SendMode Input
+SetWorkingDir %A_ScriptDir%
+
+; 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%
+} \ No newline at end of file
diff --git a/myhotkeys.ahk b/myhotkeys.ahk
new file mode 100644
index 0000000..ed795b8
--- /dev/null
+++ b/myhotkeys.ahk
@@ -0,0 +1,18 @@
+; 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
+SetWorkingDir %A_ScriptDir%
+
+#Include, _winresize.ahk
+
+; always on top
+#!t::Winset, Alwaysontop, , A
+
+; usage: ResizeWin(Width,Height,ExtraW,ExtraH,WinW,WinH)
+#!y::ResizeWin(1280,720)
+#!u::ResizeWin(1920,1080)
+
+;Horizon: Zero Dawn adds some extra pixels for no reason
+;#!i::ResizeWin(1920,1080,8,8)