From 767f52fe65d7a820b6c42d94d4b941475dd5b31c Mon Sep 17 00:00:00 2001 From: GenesisFR <3614449+GenesisFR@users.noreply.github.com> Date: Sat, 22 May 2021 20:33:57 -0400 Subject: [PATCH] + added a setting to control whether system key fixes are enabled or not --- KeyToggles.ahk | 11 ++++++----- KeyToggles.ini | 9 ++++++--- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/KeyToggles.ahk b/KeyToggles.ahk index 02c3ce8..e16a8da 100644 --- a/KeyToggles.ahk +++ b/KeyToggles.ahk @@ -1,4 +1,4 @@ -; KeyToggles v1.4 +; KeyToggles v1.5 ; TODO ; add application profiles (https://stackoverflow.com/questions/45190170/how-can-i-make-this-ini-file-into-a-listview-in-autohotkey) @@ -309,6 +309,7 @@ ReadConfigFile() IniRead, bCrouchMode, %configFileName%, General, crouchMode, 1 IniRead, bSprintMode, %configFileName%, General, sprintMode, 1 IniRead, nAutofireKeyDelay, %configFileName%, General, autofireKeyDelay, 100 + IniRead, bFixSystemKeys, %configFileName%, General, fixSystemKeys, 1 IniRead, nFocusCheckDelay, %configFileName%, General, focusCheckDelay, 1000 IniRead, nHookDelay, %configFileName%, General, hookDelay, 0 IniRead, nKeyDelay, %configFileName%, General, keyDelay, 0 @@ -346,10 +347,10 @@ RegisterHotkeys() Hotkey, %sprintAutofireKey%, sprintLabel, % bSprintMode == KEY_MODE_AUTOFIRE ? "On" : "Off" ; Fixes issues when pressing system keys while toggle keys are modifiers and are enabled - Hotkey, !Tab, SendAltTab, On - Hotkey, Escape, SendEscape, On - Hotkey, LWin, SendWindows, On - Hotkey, RWin, SendWindows, On + Hotkey, !Tab, SendAltTab, % bFixSystemKeys ? "On" : "Off" + Hotkey, Escape, SendEscape, % bFixSystemKeys ? "On" : "Off" + Hotkey, LWin, SendWindows, % bFixSystemKeys ? "On" : "Off" + Hotkey, RWin, SendWindows, % bFixSystemKeys ? "On" : "Off" } ReleaseAllKeys() diff --git a/KeyToggles.ini b/KeyToggles.ini index 7b99db3..9a25e29 100644 --- a/KeyToggles.ini +++ b/KeyToggles.ini @@ -1,4 +1,4 @@ -; KeyToggles v1.4 +; KeyToggles v1.5 [General] ; To retrieve the title of the game's window, you have 2 solutions: @@ -28,16 +28,19 @@ sprintMode=1 ; How much time to wait (in milliseconds) before sending another input in autofire mode autofireKeyDelay=100 +; Fixes common system key combinations (such as Alt+Tab) not working when toggle keys are modifiers (1 to enable) +fixSystemKeys=1 + ; How often (in milliseconds) to check whether the window is active ; If the window is no longer active, all keys will be released focusCheckDelay=1000 ; How much time to wait (in milliseconds) before hooking the window -; Increase this delay in case hotkeys don't work in some games +; Increase this delay in case hotkeys aren't working in some games hookDelay=0 ; How much time to wait (in milliseconds) between key press and release in hold/autofire mode -; Increase this delay in case inputs don't register in some games +; Increase this delay in case keystrokes aren't registered in some games keyDelay=0 ; Restore toggles to their previous state when the window regains focus (1 to enable)