AutoHotkey Community

It is currently May 26th, 2012, 8:51 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: changing hotkeys
PostPosted: July 7th, 2008, 9:14 pm 
Offline

Joined: June 27th, 2006, 4:36 pm
Posts: 182
hello, i have a gui with a set of buttons. each button should change the output of the hotkey lbutton. the problem i have is changing what that output is.

basic example of what i'm talking about (yes i know bits are missing).

Code:
Gui, Add, Button, x4 y0 w170 h30 ga , button1
Gui, Add, Button, x4 y0 w170 h30 gb , button2

a:
gui, submit, nohide
hotkey, lbutton, omg
return

b:
gui, submit, nohide
hotkey, lbutton, wtf
reload

omg:
msgbox, omg
return

wtf:
msgbox, wtf
return

_________________
Image Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 7th, 2008, 9:27 pm 
Offline
User avatar

Joined: August 30th, 2005, 8:43 pm
Posts: 8666
Location: Salem, MA
do you mean return instead of reload?
Code:

Gui, Add, Button, x4 y0 w170 h30 ga , button1
Gui, Add, Button, x4 y0 w170 h30 gb , button2

a:
gui, submit, nohide
hotkey, lbutton, omg
return

b:
gui, submit, nohide
hotkey, lbutton, wtf
return

omg:
msgbox, omg
return

wtf:
msgbox, wtf
return
:?:

_________________
Image
(Common Answers) - New Tutorials Forum - Humongous FAQ


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 7th, 2008, 9:34 pm 
Offline

Joined: June 27th, 2006, 4:36 pm
Posts: 182
oops. i'm on the right tracks anyway though?

_________________
Image Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 7th, 2008, 9:36 pm 
Offline
User avatar

Joined: August 30th, 2005, 8:43 pm
Posts: 8666
Location: Salem, MA
it seems ok, did it work?

_________________
Image
(Common Answers) - New Tutorials Forum - Humongous FAQ


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 7th, 2008, 9:40 pm 
Offline

Joined: June 27th, 2006, 4:36 pm
Posts: 182
yep

_________________
Image Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 7th, 2008, 10:09 pm 
Offline

Joined: June 27th, 2006, 4:36 pm
Posts: 182
i have another question. is this valid?

hotkey, lbutton up, label

if not, how would i do it?

_________________
Image Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 7th, 2008, 10:11 pm 
Offline
User avatar

Joined: August 30th, 2005, 8:43 pm
Posts: 8666
Location: Salem, MA
it looks valid. Did you try it?

_________________
Image
(Common Answers) - New Tutorials Forum - Humongous FAQ


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 7th, 2008, 10:12 pm 
Offline

Joined: June 27th, 2006, 4:36 pm
Posts: 182
mmm. here is an example of my code.

Code:

label:
Gui, submit, nohide
hotkey, lbutton, label_do_down
hotkey, lbutton up, label_do_up
return

label_do_down:
Send, {RButton}
return

label_do_up:
Send, {RButton}
return



but it doesn't seem to work.

_________________
Image Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 7th, 2008, 10:15 pm 
Offline
User avatar

Joined: August 30th, 2005, 8:43 pm
Posts: 8666
Location: Salem, MA
works for me as standalone:
Code:
label:
Gui, submit, nohide
hotkey, lbutton, label_do_down
hotkey, lbutton up, label_do_up
return

label_do_down:
msgbox 1
Send, {RButton}
return

label_do_up:
msgbox 2
Send, {RButton}
return

Esc::ExitApp


maybe you have some other problem?

_________________
Image
(Common Answers) - New Tutorials Forum - Humongous FAQ


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 7th, 2008, 10:41 pm 
Offline

Joined: June 27th, 2006, 4:36 pm
Posts: 182
strange :?

_________________
Image Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 8th, 2008, 5:24 pm 
Offline
User avatar

Joined: August 30th, 2005, 8:43 pm
Posts: 8666
Location: Salem, MA
we cannot help with the information you have given so far. please provide more. the code that I posted works for me running by itself, therefore it should for you (make a new ahk file and try it). I don't have the rest of your code to test with, so I have no idea what other interactions can be occurring.

_________________
Image
(Common Answers) - New Tutorials Forum - Humongous FAQ


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: kkkddd1, poserpro and 60 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