Negating the events

Non-platform specific questions.

Negating the events

Postby cubix » Wed Apr 29, 2009 5:45 pm

I want to negate KEY DOWN event. How to do that?
cubix
 
Posts: 7
Joined: Tue Apr 10, 2007 10:06 am
Location: Lomnica Zdroj, Lesser Poland, PL
Score: 0 Give a positive score

Re: Negating the events

Postby j2graves » Wed Apr 29, 2009 6:00 pm

did you make a keydown event that you want to remove?
No games to my name...
User avatar
j2graves
 
Posts: 1302
Joined: Thu Aug 16, 2007 6:42 pm
Location: on the other side of infinity
Score: 19 Give a positive score

Re: Negating the events

Postby Kalladdolf » Wed Apr 29, 2009 6:01 pm

The Action is called "Event Disable".
Choose the action and then the event you want to disable.
User avatar
Kalladdolf
 
Posts: 2427
Joined: Sat Sep 08, 2007 8:22 am
Location: Germany
Score: 120 Give a positive score

Re: Negating the events

Postby cubix » Wed Apr 29, 2009 6:07 pm

j2graves wrote:did you make a keydown event that you want to remove?

Yes, I did
cubix
 
Posts: 7
Joined: Tue Apr 10, 2007 10:06 am
Location: Lomnica Zdroj, Lesser Poland, PL
Score: 0 Give a positive score

Re: Negating the events

Postby j2graves » Wed Apr 29, 2009 8:30 pm

here:
guide.png
No games to my name...
User avatar
j2graves
 
Posts: 1302
Joined: Thu Aug 16, 2007 6:42 pm
Location: on the other side of infinity
Score: 19 Give a positive score

Re: Negating the events

Postby cubix » Thu Apr 30, 2009 12:36 pm

You didn't understand.
I want to make event like "When key isn't pressed"
cubix
 
Posts: 7
Joined: Tue Apr 10, 2007 10:06 am
Location: Lomnica Zdroj, Lesser Poland, PL
Score: 0 Give a positive score

Re: Negating the events

Postby skydereign » Thu Apr 30, 2009 1:00 pm

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
}
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Negating the events

Postby cubix » Thu Apr 30, 2009 3:20 pm

Thank you :mrgreen:
cubix
 
Posts: 7
Joined: Tue Apr 10, 2007 10:06 am
Location: Lomnica Zdroj, Lesser Poland, PL
Score: 0 Give a positive score

Re: Negating the events

Postby Fuzzy » Thu Apr 30, 2009 3:53 pm

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.
Mortal Enemy of IF....THEN(and Inspector Gadget)

Still ThreeFingerPete to tekdino
User avatar
Fuzzy
 
Posts: 1068
Joined: Thu Mar 03, 2005 9:32 am
Location: Plymostic Programmer
Score: 95 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron