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 

changing hotkeys

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Clash



Joined: 27 Jun 2006
Posts: 182

PostPosted: Mon Jul 07, 2008 9:14 pm    Post subject: changing hotkeys Reply with quote

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

_________________
Back to top
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 6772
Location: Pacific Northwest, US

PostPosted: Mon Jul 07, 2008 9:27 pm    Post subject: Reply with quote

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
Question
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
Clash



Joined: 27 Jun 2006
Posts: 182

PostPosted: Mon Jul 07, 2008 9:34 pm    Post subject: Reply with quote

oops. i'm on the right tracks anyway though?
_________________
Back to top
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 6772
Location: Pacific Northwest, US

PostPosted: Mon Jul 07, 2008 9:36 pm    Post subject: Reply with quote

it seems ok, did it work?
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
Clash



Joined: 27 Jun 2006
Posts: 182

PostPosted: Mon Jul 07, 2008 9:40 pm    Post subject: Reply with quote

yep
_________________
Back to top
View user's profile Send private message
Clash



Joined: 27 Jun 2006
Posts: 182

PostPosted: Mon Jul 07, 2008 10:09 pm    Post subject: Reply with quote

i have another question. is this valid?

hotkey, lbutton up, label

if not, how would i do it?
_________________
Back to top
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 6772
Location: Pacific Northwest, US

PostPosted: Mon Jul 07, 2008 10:11 pm    Post subject: Reply with quote

it looks valid. Did you try it?
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
Clash



Joined: 27 Jun 2006
Posts: 182

PostPosted: Mon Jul 07, 2008 10:12 pm    Post subject: Reply with quote

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.
_________________
Back to top
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 6772
Location: Pacific Northwest, US

PostPosted: Mon Jul 07, 2008 10:15 pm    Post subject: Reply with quote

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?
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
Clash



Joined: 27 Jun 2006
Posts: 182

PostPosted: Mon Jul 07, 2008 10:41 pm    Post subject: Reply with quote

strange Confused
_________________
Back to top
View user's profile Send private message
bugmenot



Joined: 03 Jul 2006
Posts: 40

PostPosted: Tue Jul 08, 2008 3:33 pm    Post subject: Reply with quote

hmm there is defently something wrong with this
Back to top
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 6772
Location: Pacific Northwest, US

PostPosted: Tue Jul 08, 2008 5:24 pm    Post subject: Reply with quote

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.
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   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