AutoHotkey Community

It is currently May 27th, 2012, 2:51 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: November 27th, 2009, 4:07 am 
I have been plying around with AHK for the last few hours and I am wondering if there is a way to rebind a key (or disable it) via a button on a GUI or right click on the tray. I have everything set up, just need to know if that is possible.
-Shadow


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 27th, 2009, 7:00 am 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
Yes it is, use a subroutine and Hotkey command.
Code:
Hotkey,a,HotkeyOFF,Off
Gui,Add,Edit
Gui,Add,Button,gSub,Off
Gui,+LastFound
hwnd:=WinExist()
Gui,Show
Return
GuiClose:
ExitApp
Sub:
toggle:=!toggle
Hotkey,a,% toggle ? "On" : "Off"
ControlSetText,Button1,% toggle ? "On" : "Off",ahk_id %hwnd%
Return

HotkeyOFF:
Return

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 28th, 2009, 4:21 am 
Exactly what I was looking for.


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: rbrtryn, XstatyK and 25 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