 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Clash
Joined: 27 Jun 2006 Posts: 182
|
Posted: Mon Jul 07, 2008 9:14 pm Post subject: changing hotkeys |
|
|
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 |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 6772 Location: Pacific Northwest, US
|
Posted: Mon Jul 07, 2008 9:27 pm Post subject: |
|
|
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
|
 _________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM |
|
| Back to top |
|
 |
Clash
Joined: 27 Jun 2006 Posts: 182
|
Posted: Mon Jul 07, 2008 9:34 pm Post subject: |
|
|
oops. i'm on the right tracks anyway though? _________________
 |
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 6772 Location: Pacific Northwest, US
|
Posted: Mon Jul 07, 2008 9:36 pm Post subject: |
|
|
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 |
|
 |
Clash
Joined: 27 Jun 2006 Posts: 182
|
Posted: Mon Jul 07, 2008 9:40 pm Post subject: |
|
|
yep _________________
 |
|
| Back to top |
|
 |
Clash
Joined: 27 Jun 2006 Posts: 182
|
Posted: Mon Jul 07, 2008 10:09 pm Post subject: |
|
|
i have another question. is this valid?
hotkey, lbutton up, label
if not, how would i do it? _________________
 |
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 6772 Location: Pacific Northwest, US
|
Posted: Mon Jul 07, 2008 10:11 pm Post subject: |
|
|
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 |
|
 |
Clash
Joined: 27 Jun 2006 Posts: 182
|
Posted: Mon Jul 07, 2008 10:12 pm Post subject: |
|
|
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 |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 6772 Location: Pacific Northwest, US
|
Posted: Mon Jul 07, 2008 10:15 pm Post subject: |
|
|
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 |
|
 |
Clash
Joined: 27 Jun 2006 Posts: 182
|
Posted: Mon Jul 07, 2008 10:41 pm Post subject: |
|
|
strange  _________________
 |
|
| Back to top |
|
 |
bugmenot
Joined: 03 Jul 2006 Posts: 40
|
Posted: Tue Jul 08, 2008 3:33 pm Post subject: |
|
|
| hmm there is defently something wrong with this |
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 6772 Location: Pacific Northwest, US
|
Posted: Tue Jul 08, 2008 5:24 pm Post subject: |
|
|
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 |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|