Page 1 of 1
opposite of IsKeyDown and self.key_pressed
Posted: Thu May 01, 2008 8:47 pm
by Danimita92
Hi everybody. I opened this topic because in my scripted player, various times I have found the need to ask the script when a certain key isn't pressed.
For example I use:
if(IsKeyDown(46))
or
if(self.key_pressed = 46)
to detect if SPACE is being pressed. But how do i detect if space isn't being pressed?
Re: opposite of IsKeyDown and self.key_pressed
Posted: Thu May 01, 2008 8:51 pm
by Juutis
if(IsKeyDown(46) = false)
Or
if(!IsKeyDown(46))
(Not sure about this, I've never really used the '!')
Re: opposite of IsKeyDown and self.key_pressed
Posted: Thu May 01, 2008 8:54 pm
by Danimita92
Thanks for such a quick reply Juutis

Re: opposite of IsKeyDown and self.key_pressed
Posted: Thu May 01, 2008 9:16 pm
by Graywolf
Simkin uses an actual "not"...
if(not IsKeyDown(key))
{
;
}
Re: opposite of IsKeyDown and self.key_pressed
Posted: Thu May 01, 2008 10:08 pm
by Juutis
Oh, never knew that. Thanks for the info.
Re: opposite of IsKeyDown and self.key_pressed
Posted: Thu May 01, 2008 10:26 pm
by Danimita92
Wow thanks to you to, graywolf
Re: opposite of IsKeyDown and self.key_pressed
Posted: Fri May 02, 2008 12:28 am
by Graywolf
You're welcome. If you have any more, questions, throw'em at me. I'll help if I can.