Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
- ; #Warn ; Enable warnings to assist with detecting common errors.
- ;SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
- SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
- ; Set hotkeys.
- Keys := ["q", "Q", "w", "W"] ; Q and W mapped for example.
- ; Assign macro.
- for index, element in Keys
- {
- element_up := element . " UP"
- Hotkey, $%element%, Macro, Off
- Hotkey, $%element_up%, Macro
- }
- Macro:
- ; Prepare key
- StringReplace, ThisHotkey, A_ThisHotkey, $
- StringReplace, ThisHotkey, ThisHotkey, %A_SPACE%UP
- ; Press key
- Send {Blind}%ThisHotkey%
- Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement