Skip to content

Commit

Permalink
+ added a setting to control whether system key fixes are enabled or not
Browse files Browse the repository at this point in the history
  • Loading branch information
GenesisFR committed May 23, 2021
1 parent 267b82c commit 767f52f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
11 changes: 6 additions & 5 deletions KeyToggles.ahk
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down
9 changes: 6 additions & 3 deletions KeyToggles.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; KeyToggles v1.4
; KeyToggles v1.5

[General]
; To retrieve the title of the game's window, you have 2 solutions:
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 767f52f

Please sign in to comment.