AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

let user change default hotkey combination

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
gark
Guest





PostPosted: Tue Mar 16, 2010 9:29 am    Post subject: let user change default hotkey combination Reply with quote

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
Back to top
SoLong&Thx4AllTheFish



Joined: 27 May 2007
Posts: 4999

PostPosted: Tue Mar 16, 2010 9:32 am    Post subject: Reply with quote

Check the hotkey command (hotkey, var, label)
_________________
AHK Wiki FAQ
TF : Text files & strings lib, TF Forum
Back to top
View user's profile Send private message
Learning one



Joined: 04 Apr 2009
Posts: 1000
Location: Croatia

PostPosted: Tue Mar 16, 2010 4:53 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
jaco0646



Joined: 07 Oct 2006
Posts: 3113
Location: MN, USA

PostPosted: Tue Mar 16, 2010 5:03 pm    Post subject: Reply with quote

I've written a fairly comprehensive demonstration of the hotkey command as well: User-defined Dynamic Hotkeys.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group