SRL Archive - OSR Help

KeyUp( GetKeyCode(' ') );


YoHoJo

2012-02-12 01:06:45

Two questions, is a proper/safe way for pressing and releasing Space bar


KeyDown( GetKeyCode(' ') );
Wait(blah);
KeyUp( GetKeyCode(' ') );

Secondly, if I call
KeyUp( GetKeyCode(' ') );
excessively (basically meaning, if I never told script to KeyDown, but tell script to KeyUp, will that even go though/will it look weird on RS?

drawboy11

2012-02-12 01:10:58

I think the "key up" would only have an effect in Simba, not sure about the other question.

YoHoJo

2012-02-12 01:12:35

I'm assuming if I call KeyUp, and they key isn't even down, then nothing will be sent, so it should be okay to call it 'too much'.

drawboy11

2012-02-12 01:14:15

From: YoHoJo
I'm assuming if I call KeyUp, and they key isn't even down, then nothing will be sent, so it should be okay to call it 'too much'.


I agree, nothing should be sent. I would give it a go, nothing should happen. As for the space bar, thats the only way I know of calling it aha

senrath

2012-02-12 01:14:25

It would register as a long string of KEY_RELEASED events in Java, so it would be easy to spot if they were looking for it. And yes, I've tested this. Simba does send the event, and Java can pick it up.

YoHoJo

2012-02-12 01:45:44

So it will be safe then senrath?!
You're saying Simba doesn't send it, so if simba doesn't send a KeyRelease if they key isn't down, then it should be fine?

senrath

2012-02-12 02:15:59

You, um, misread what I said. I said that it does send it, and that Java does register that you sent it.

YoHoJo

2012-02-12 02:18:45

LOL! :D Gotcha, thanks!
I misread your part that 'Simba DOES' as doesn't, so I thought I was okay. Thanks!

Daniel

2012-02-12 02:35:41

if(IsKeyDown(32)) then
KeyUp(32)

? :p