Page 1 of 1

Negating the events

PostPosted: Wed Apr 29, 2009 5:45 pm
by cubix
I want to negate KEY DOWN event. How to do that?

Re: Negating the events

PostPosted: Wed Apr 29, 2009 6:00 pm
by j2graves
did you make a keydown event that you want to remove?

Re: Negating the events

PostPosted: Wed Apr 29, 2009 6:01 pm
by Kalladdolf
The Action is called "Event Disable".
Choose the action and then the event you want to disable.

Re: Negating the events

PostPosted: Wed Apr 29, 2009 6:07 pm
by cubix
j2graves wrote:did you make a keydown event that you want to remove?

Yes, I did

Re: Negating the events

PostPosted: Wed Apr 29, 2009 8:30 pm
by j2graves
here:
guide.png

Re: Negating the events

PostPosted: Thu Apr 30, 2009 12:36 pm
by cubix
You didn't understand.
I want to make event like "When key isn't pressed"

Re: Negating the events

PostPosted: Thu Apr 30, 2009 1:00 pm
by skydereign
Depending on what you want to do you can either, replace the system and make it backwards, ie. put whatever is in the keydown into the draw, and make the keydown do the opposite, or you can put the code into the draw script. If, the key not pressed is a constant,then you could also just make a keyup and create actor. I would suggest draw actor.
Actor->DrawActor->ScriptEditor
Code: Select all
char* key = GetKeyState(); // sets the state of keys
if(key[KEY_t]==0) // if t key is not pressed
{
    //your code goes here
}

Re: Negating the events

PostPosted: Thu Apr 30, 2009 3:20 pm
by cubix
Thank you :mrgreen:

Re: Negating the events

PostPosted: Thu Apr 30, 2009 3:53 pm
by Fuzzy
Make a variable, keyNotPressed or something. start it with a value of 1. have a key down event for the key in question. in this, set the value of keyNotPressed to 0. In key up event set it back to 1.

Now you just have to test the value of keyNotPressed and if its 1, then do the action. Place the check and the action in the draw event for the actor.