AutoHotkey Community

It is currently May 27th, 2012, 5:40 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: March 16th, 2010, 10:29 am 
hi,

i already have a perfect working autohotkey script but i'd like to add an option where the user can change the default hotkey combination (its only one) to his own...

i would be quite happy if someone can give me a clue where to start.

tia


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 16th, 2010, 10:32 am 
Offline

Joined: May 27th, 2007, 9:41 am
Posts: 4999
Check the hotkey command (hotkey, var, label)

_________________
AHK FAQ
TF : Text files & strings lib, TF Forum


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 16th, 2010, 5:53 pm 
Offline
User avatar

Joined: April 4th, 2009, 8:19 pm
Posts: 1143
Location: Croatia
Example4you
Code:
;===Settings============================================================================
Hotkey = 1      ; default hotkey


;===Auto-execute continuation===========================================================
Hotkey, %Hotkey%, HotkeySubroutine
DefaultHotkeyBackup := Hotkey

Gui 1: Add, Hotkey, x5 y6 w130 vHotkey, %Hotkey%
Gui 1: Add,  Button, x145 y5, Apply
Gui 1: show, w190, Change hotkey
Return      ;===Auto-execute ends here===


;===Subroutines=========================================================================
ButtonApply:
Hotkey, %Hotkey%, HotkeySubroutine, off
Gui 1: submit, nohide
if Hotkey =      ; security: if user didn't specified hotkey in dialog and clicked Apply, use default hotkey
Hotkey := DefaultHotkeyBackup
Hotkey, %Hotkey%, HotkeySubroutine, on
Return

GuiClose:
ExitApp

HotkeySubroutine:
MsgBox,,, Hotkey works.,1
Return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 16th, 2010, 6:03 pm 
Offline

Joined: October 7th, 2006, 4:50 pm
Posts: 3157
Location: MN, USA
I've written a fairly comprehensive demonstration of the hotkey command as well: User-defined Dynamic Hotkeys.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google [Bot], HotkeyStick, mrhobbeys, rbrtryn and 59 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group