Advertisement
Guest User

Untitled

a guest
Jan 18th, 2018
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
  2. ; #Warn ; Enable warnings to assist with detecting common errors.
  3. ;SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
  4. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
  5.  
  6. ; Set hotkeys.
  7. Keys := ["q", "Q", "w", "W"] ; Q and W mapped for example.
  8.  
  9. ; Assign macro.
  10. for index, element in Keys
  11. {
  12. element_up := element . " UP"
  13. Hotkey, $%element%, Macro, Off
  14. Hotkey, $%element_up%, Macro
  15. }
  16.  
  17. Macro:
  18. ; Prepare key
  19. StringReplace, ThisHotkey, A_ThisHotkey, $
  20. StringReplace, ThisHotkey, ThisHotkey, %A_SPACE%UP
  21.  
  22. ; Press key
  23. Send {Blind}%ThisHotkey%
  24. Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement