Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Please explain this simple code snippet


  • Please log in to reply
2 replies to this topic
Spagnum
  • Members
  • 2 posts
  • Last active: Oct 30 2013 04:43 PM
  • Joined: 09 Dec 2012

Hi

 

I have found this snippet of code multiple places, it is used to detect any keypress:

 

 

 

Loop 26 
   HotKey % Chr(A_Index+96), Hotty
Return 


Hotty: 
; do something
Return

How exactly does it work?

 

Furthermore I want Hotty to capture the key, but I also want the key to be sent, this is normally done with a ~, how can I do this here?

 
Thanks in advance


guest3456
  • Members
  • 1704 posts
  • Last active: Nov 19 2015 11:58 AM
  • Joined: 10 Mar 2011
this is the wrong forum, you should post in the Support forum when you need help

anyway, what exactly don't you understand? there are help docs here for every command used:
http://www.autohotkey.com/docs/

basically the script turns on 26 hotkeys corresponding to every letter of the alphabet, all pointing to the same label when pressed.

Leef_me
  • Moderators
  • 8510 posts
  • Last active: Sep 10 2015 05:50 AM
  • Joined: 08 Apr 2009

Hi Spagnum, welcome to the forum.

 

Have you worked through the tutorial :?: http://www.autohotke...cs/Tutorial.htm

 

Concerning 'capturing' the hotkey look at A_ThisHotkey

http://www.autohotke...les.htm#BuiltIn