Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: GenesisFR/KeyToggles
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.3
Choose a base ref
...
head repository: GenesisFR/KeyToggles
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Feb 14, 2021

  1. Copy the full SHA
    dab3104 View commit details
  2. Copy the full SHA
    0079850 View commit details

Commits on Feb 15, 2021

  1. + added support for delaying hotkey hooking to fix a bug where hotkey…

    …s weren't working when hooked too early
    GenesisFR authored Feb 15, 2021
    Copy the full SHA
    df66355 View commit details
  2. - minor code refactoring

    GenesisFR authored Feb 15, 2021
    Copy the full SHA
    a856b78 View commit details

Commits on Feb 25, 2021

  1. Copy the full SHA
    83cb032 View commit details
  2. Copy the full SHA
    18c18a0 View commit details
  3. + added a setting to control whether to restore toggles on focus or not

    - split settings into separate sections
    GenesisFR authored Feb 25, 2021
    Copy the full SHA
    92df083 View commit details
  4. Copy the full SHA
    bcabe53 View commit details

Commits on Apr 24, 2021

  1. - removed extra spacing

    GenesisFR authored Apr 24, 2021
    Copy the full SHA
    bc06635 View commit details

Commits on Apr 27, 2021

  1. - renamed to KeyToggles

    GenesisFR committed Apr 27, 2021
    Copy the full SHA
    2d07445 View commit details

Commits on Apr 28, 2021

  1. Copy the full SHA
    c3da923 View commit details

Commits on May 2, 2021

  1. Copy the full SHA
    7441468 View commit details
  2. - removed debug code

    GenesisFR committed May 2, 2021
    Copy the full SHA
    08246b8 View commit details
  3. - major code refactoring

    GenesisFR committed May 2, 2021
    Copy the full SHA
    778f487 View commit details
  4. Copy the full SHA
    5edc88b View commit details
  5. Copy the full SHA
    c3ababa View commit details
  6. Copy the full SHA
    481d679 View commit details
  7. + added debug traces

    GenesisFR committed May 2, 2021
    Copy the full SHA
    6e67417 View commit details

Commits on May 3, 2021

  1. Copy the full SHA
    5c35093 View commit details

Commits on May 6, 2021

  1. * fixed an issue where hotkeys were no longer working after quitting …

    …a game from the desktop
    
    - removed a couple of debug traces to limit console spam
    - minor code refactoring
    GenesisFR committed May 6, 2021
    Copy the full SHA
    ec6fadf View commit details

Commits on May 8, 2021

  1. + added key hold support

    + added a setting to control how long to wait between key press and release in hold mode
    - restoreTogglesOnFocus is now disabled by default
    GenesisFR committed May 8, 2021
    Copy the full SHA
    d3e3bec View commit details
  2. + added autofire support

    + added toggle keys to autofire
    + added a setting to control how long to wait before sending another input in autofire mode
    - removed bDebug as it wasn't used anymore
    GenesisFR committed May 8, 2021
    Copy the full SHA
    360477d View commit details
  3. - updated version number

    GenesisFR committed May 8, 2021
    Copy the full SHA
    935e892 View commit details
  4. Copy the full SHA
    d5173fe View commit details
  5. * fixed typos in the default autofire keys in the readme

    - various wording tweaks
    GenesisFR committed May 8, 2021
    Copy the full SHA
    ac43093 View commit details

Commits on May 9, 2021

  1. + added a release script

    GenesisFR committed May 9, 2021
    Copy the full SHA
    431cbaa View commit details
  2. + added a release script

    * fixed main hotkeys enabled with key mode values higher than AIM_MODE_AUTOFIRE (3)
    GenesisFR committed May 9, 2021
    Copy the full SHA
    d34a324 View commit details
  3. Copy the full SHA
    1d09775 View commit details

Commits on May 11, 2021

  1. - the script will now exit with an error message if the window name i…

    …sn't specified
    
    - the OnExit function shouldn't call ExitApp
    GenesisFR committed May 11, 2021
    Copy the full SHA
    d94494e View commit details

Commits on May 13, 2021

  1. * fixed warnings on exit when the window name hasn't been specified

    - renamed restoreTogglesOnFocus to bRestoreTogglesOnFocus
    GenesisFR committed May 13, 2021
    Copy the full SHA
    db093fd View commit details
  2. - minor refactoring

    GenesisFR committed May 13, 2021
    Copy the full SHA
    75fd6f4 View commit details
  3. + added a setting to control whether to show notifications or not

    - minor code refactoring
    GenesisFR committed May 13, 2021
    Copy the full SHA
    27ab9ad View commit details
  4. Copy the full SHA
    3714c4e View commit details

Commits on May 14, 2021

  1. Copy the full SHA
    504d5fe View commit details
  2. Copy the full SHA
    e98bc5b View commit details
  3. Copy the full SHA
    a918c0d View commit details

Commits on May 15, 2021

  1. Copy the full SHA
    6e3fb1b View commit details
  2. Copy the full SHA
    53dcc80 View commit details
  3. * fixed an issue where toggle keys were only saved/restored if the ai…

    …m key was set to toggle mode
    GenesisFR committed May 15, 2021
    Copy the full SHA
    2f60e3a View commit details

Commits on May 17, 2021

  1. * fixed an issue where clicks couldn't be sent outside the window whe…

    …n one of the mouse clicks is toggled
    GenesisFR committed May 17, 2021
    Copy the full SHA
    c36d881 View commit details
  2. Copy the full SHA
    2edd077 View commit details
  3. - moderate code refactoring

    GenesisFR committed May 17, 2021
    Copy the full SHA
    3fdeb66 View commit details

Commits on May 22, 2021

  1. - moderate code refactoring

    GenesisFR committed May 22, 2021
    Copy the full SHA
    53e9c13 View commit details
  2. Copy the full SHA
    ecfd1e8 View commit details
  3. Copy the full SHA
    a429c5f View commit details

Commits on May 23, 2021

  1. + added a debug setting to close the script (ALT+F10) and reload it (…

    …ALT+F11)
    
    - keys are now only released when suspending the script
    GenesisFR committed May 23, 2021
    Copy the full SHA
    267b82c View commit details
  2. Copy the full SHA
    767f52f View commit details
Showing with 691 additions and 202 deletions.
  1. +0 −33 .gitignore
  2. +0 −132 HoldToggles.ahk
  3. +0 −30 HoldToggles.ini
  4. +604 −0 KeyToggles.ahk
  5. +70 −0 KeyToggles.ini
  6. +16 −7 README.md
  7. +1 −0 release.bat
33 changes: 0 additions & 33 deletions .gitignore

This file was deleted.

132 changes: 0 additions & 132 deletions HoldToggles.ahk

This file was deleted.

30 changes: 0 additions & 30 deletions HoldToggles.ini

This file was deleted.

604 changes: 604 additions & 0 deletions KeyToggles.ahk

Large diffs are not rendered by default.

70 changes: 70 additions & 0 deletions KeyToggles.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
; KeyToggles v1.5

[General]
; To retrieve the title of the game's window, you have 2 solutions:
;
; Method 1
; 1. Launch your game in windowed mode.
; 2. The name of the window will be displayed on the left side of the title bar.
;
; Method 2
; 1. Launch your game
; 2. Tab out.
; 3. Open Task Manager.
; 4. Go to the Processes tab.
; 5. Expand the entry corresponding to your game.
; 6. The name of the window will be one of the expanded entries.
windowName="put_window_name_here"

; Use these to set key modes individually
; 0: disable
; 1: toggle (for keys that must be held down)
; 2: hold (for keys that only work as toggles)
; 3: autofire (toggled by the autofire keys)
aimMode=1
crouchMode=1
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 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 keystrokes aren't registered in some games
keyDelay=0

; Restore toggles to their previous state when the window regains focus (1 to enable)
restoreTogglesOnFocus=0

; Force the script to run as admin (1 to enable)
runAsAdmin=0

; Show notifications when certain events (such as window hooking) occur (1 to enable)
showNotifications=0

; See https://www.autohotkey.com/docs/KeyList.htm for key IDs
[Keys]
; Main keys (disabled if set to autofire mode)
aimKey=RButton
crouchKey=LControl
sprintKey=LShift

; Autofire keys (disabled if not set to autofire mode)
; Repeatedly simulate pressing the corresponding main key until pressed again
aimAutofireKey=F1
crouchAutofireKey=F2
sprintAutofireKey=F3

[Debug]
; Enable debug functions such as closing (ALT+F10) or reloading (ALT+F11) the script (1 to enable)
debugMode=0
23 changes: 16 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,34 @@
# HoldToggles
An AutoHotkey 1.1 script that makes keys and mouse buttons togglable so that you don't have to hold them to crouch, sprint or aim in games.
# KeyToggles
An AutoHotkey 1.1 script that can change the input mode of keys and mouse buttons.

3 modes are currently supported:
- toggle: you don't have to hold the key to perform its action.
- hold: you have to hold the key to perform its action.
- autofire: same as toggle except it will repeatedly perform the action of another key.

## Installation

You can run the script from anywhere as long as "HoldToggles.ini" is in the same directory than the script.
You can run the script from anywhere as long as "KeyToggles.ini" is in the same directory than the script.

## Usage

The script will only be active when the game's window is in focus. Please read "HoldToggles.ini" for more information about setting it up.
Make sure that your keys or mouse buttons in "HoldToggles.ini" are the same than the ones in the game.
The script will only be active when the specified window is in focus. Please read "KeyToggles.ini" for more information about setting it up.

Make sure that your keys or mouse buttons in "KeyToggles.ini" are the same than the ones in the game.

Default keys:

Right-click: toggle aim
Left CTRL: toggle crouch
Left SHIFT: toggle sprint
Right-click: toggle aim
F1: toggle aim autofire
F2: toggle crouch autofire
F3: toggle sprint autofire
Left ALT + F12: pause the script (disable all hotkeys)

For games run as admin, you must also run the script as admin for it to work.

## Limitations

I've only tested the script in Half-Life 1, Half-Life 2 and Unity games.
I've only tested the script in Aliens: Colonial Marines, Half-Life 1, Half-Life 2 and some Unity games.
It will not work in games that prevent keys from being simulated (ex: games using anti-cheats).
1 change: 1 addition & 0 deletions release.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
powershell -Command Compress-Archive -Path "KeyToggles.exe", "KeyToggles.ini", "README.md" -Update -DestinationPath "KeyToggles.zip"