Difference between revisions of "AHK"
sindenlightgun>Titchgamer (Created page with "Auto Hot Key (AHK) is small but powerful automation scripting language for windows. In this Quick video I demonstrate how to install AHK and create your first script. All AHK...") |
sindenlightgun>Overboardkiller |
||
| Line 6: | Line 6: | ||
<youtube>https://youtu.be/9OulkTSZSp4</youtube> |
<youtube>https://youtu.be/9OulkTSZSp4</youtube> |
||
==== Change DPI AHK ==== |
|||
Script to change Res and DPI settings.(Windows 10, Windows 7 Not tested.) |
|||
<syntaxhighlight lang="autohotkey" line="1"> |
|||
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. |
|||
SendMode Input ; Recommended for new scripts due to its superior speed and reliability. |
|||
#SingleInstance force |
|||
!#PgDn:: |
|||
RegWrite, REG_DWORD, HKEY_CURRENT_USER\Control Panel\Desktop\PerMonitorSettings\ACR0408#ASNmpEVZnard_00_07DD_A1^1977EFB0FCDDA00B4A190B2C0A4C2256, DpiValue, 1 |
|||
ChangeResolution(2560, 1440) |
|||
Return |
|||
!#PgUp:: |
|||
RegWrite, REG_DWORD, HKEY_CURRENT_USER\Control Panel\Desktop\PerMonitorSettings\ACR0408#ASNmpEVZnard_00_07DD_A1^1977EFB0FCDDA00B4A190B2C0A4C2256, DpiValue, 0 |
|||
ChangeResolution(2560, 1440) |
|||
Return |
|||
ChangeResolution(Screen_Width := 2560, Screen_Height := 1440, Color_Depth := 32) |
|||
{ |
|||
VarSetCapacity(Device_Mode,156,0) |
|||
NumPut(156,Device_Mode,36) |
|||
DllCall( "EnumDisplaySettingsA", UInt,0, UInt,-1, UInt,&Device_Mode ) |
|||
NumPut(0x5c0000,Device_Mode,40) |
|||
NumPut(Color_Depth,Device_Mode,104) |
|||
NumPut(Screen_Width,Device_Mode,108) |
|||
NumPut(Screen_Height,Device_Mode,112) |
|||
Return DllCall( "ChangeDisplaySettingsA", UInt,&Device_Mode, UInt,0 ) |
|||
} |
|||
Return |
|||
</syntaxhighlight>This scripts helps change DPI and Resolution of your monitor in windows 10. Some games need the DPI to be 100% or the gun will not work |
|||
lets talk through this script |
|||
Line 6: this is the hotkey to change enable the change (currently set to ! (ALT) + # (WinKey) + PageDown |
|||
Line 7: "ACR0408#ASNmpEVZnard_00_07DD_A1^1977EFB0FCDDA00B4A190B2C0A4C2256" is the name of my monitor this will need to be changed to your monitor name This can be found here |
|||
[[File:ChangeDPIMonitorName.png|none|thumb|800x800px]] |
|||
The DPIValue are the following 0 = 100%, 1 = 125%, 2= 150%, 3= 175% and 4= 200% |
|||
Line 8: this is for your Resalution settings |
|||
Line 11 to 14 are the same as above You need to change these settings also |
|||
Line 18 to 25: you don't need to change anything here. This just changes the settings and applies them. If this isn't here the regedit would not change anything |
|||
NOTE if you have 2 or more monitors you will need to choose one under HKEY_CURRENT_USER\Control Panel\Desktop\PerMonitorSettings\ and do a trail and error. I don't know how windows makes this reg folder for the display name. |
|||
Revision as of 04:30, 10 January 2021
Auto Hot Key (AHK) is small but powerful automation scripting language for windows.
In this Quick video I demonstrate how to install AHK and create your first script. All AHK commands can be found here if you are creating your own scripts: https://www.autohotkey.com/docs/AutoHotkey.htm
Change DPI AHK
Script to change Res and DPI settings.(Windows 10, Windows 7 Not tested.)
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
#SingleInstance force
!#PgDn::
RegWrite, REG_DWORD, HKEY_CURRENT_USER\Control Panel\Desktop\PerMonitorSettings\ACR0408#ASNmpEVZnard_00_07DD_A1^1977EFB0FCDDA00B4A190B2C0A4C2256, DpiValue, 1
ChangeResolution(2560, 1440)
Return
!#PgUp::
RegWrite, REG_DWORD, HKEY_CURRENT_USER\Control Panel\Desktop\PerMonitorSettings\ACR0408#ASNmpEVZnard_00_07DD_A1^1977EFB0FCDDA00B4A190B2C0A4C2256, DpiValue, 0
ChangeResolution(2560, 1440)
Return
ChangeResolution(Screen_Width := 2560, Screen_Height := 1440, Color_Depth := 32)
{
VarSetCapacity(Device_Mode,156,0)
NumPut(156,Device_Mode,36)
DllCall( "EnumDisplaySettingsA", UInt,0, UInt,-1, UInt,&Device_Mode )
NumPut(0x5c0000,Device_Mode,40)
NumPut(Color_Depth,Device_Mode,104)
NumPut(Screen_Width,Device_Mode,108)
NumPut(Screen_Height,Device_Mode,112)
Return DllCall( "ChangeDisplaySettingsA", UInt,&Device_Mode, UInt,0 )
}
ReturnThis scripts helps change DPI and Resolution of your monitor in windows 10. Some games need the DPI to be 100% or the gun will not work
lets talk through this script
Line 6: this is the hotkey to change enable the change (currently set to ! (ALT) + # (WinKey) + PageDown
Line 7: "ACR0408#ASNmpEVZnard_00_07DD_A1^1977EFB0FCDDA00B4A190B2C0A4C2256" is the name of my monitor this will need to be changed to your monitor name This can be found here
The DPIValue are the following 0 = 100%, 1 = 125%, 2= 150%, 3= 175% and 4= 200%
Line 8: this is for your Resalution settings
Line 11 to 14 are the same as above You need to change these settings also
Line 18 to 25: you don't need to change anything here. This just changes the settings and applies them. If this isn't here the regedit would not change anything
NOTE if you have 2 or more monitors you will need to choose one under HKEY_CURRENT_USER\Control Panel\Desktop\PerMonitorSettings\ and do a trail and error. I don't know how windows makes this reg folder for the display name.