| View previous topic :: View next topic |
| Author |
Message |
gpoint
Joined: 02 Jan 2007 Posts: 9
Digg It |
Posted: Tue Feb 06, 2007 6:30 pm Post subject: How to keep a button pressed? |
|
|
Hello, I am creating a little script for playing Metal Slug on my pc.
What I would like to do is to fire as long as I keep my Wiimote.One Button pressed.
I need to press this button as many time as I can to fire all the time and I would like to simply keep it pressed to fire, then stop to fire when I stop to press the button.
Anybody can help me plz? |
|
| Back to top |
|
 |
CarlKenner Site Admin
Joined: 29 Nov 2006 Posts: 614
Digg It |
Posted: Tue Feb 06, 2007 6:40 pm Post subject: |
|
|
| Code: | if wiimote.one then
press Space
wait 10 ms
release Space
wait 10 ms
end if |
Change it to whatever key you want instead of Space.[/code] |
|
| Back to top |
|
 |
gpoint
Joined: 02 Jan 2007 Posts: 9
Digg It |
Posted: Tue Feb 06, 2007 7:55 pm Post subject: |
|
|
Thanks A LOT!
It works like a charm! |
|
| Back to top |
|
 |
psycho
Joined: 22 Nov 2006 Posts: 43
Digg It |
Posted: Tue Feb 06, 2007 8:52 pm Post subject: |
|
|
or it could use a few more lines and only be pressed when the button is pressed (if I understand your questrion right)
| Code: |
if wiimote.one
Key.Space = true
wait 10ms
wiimote.one = false
key.space = false
endif
|
If you want it to press, and then unpress, use the above code. |
|
| Back to top |
|
 |
|