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?
opposite of IsKeyDown and self.key_pressed
-
- Posts: 335
- Joined: Sat Feb 09, 2008 5:47 pm
- Location: Lanzarote/Canary Islands/Spain
Re: opposite of IsKeyDown and self.key_pressed
if(IsKeyDown(46) = false)
Or
if(!IsKeyDown(46))
(Not sure about this, I've never really used the '!')
Or
if(!IsKeyDown(46))
(Not sure about this, I've never really used the '!')
Pain is only psychological.
-
- Posts: 335
- Joined: Sat Feb 09, 2008 5:47 pm
- Location: Lanzarote/Canary Islands/Spain
Re: opposite of IsKeyDown and self.key_pressed
Thanks for such a quick reply Juutis 

Re: opposite of IsKeyDown and self.key_pressed
Simkin uses an actual "not"...
if(not IsKeyDown(key))
{
;
}
if(not IsKeyDown(key))
{
;
}
"So, what's the life of a programmer like?" "...Huh? What life?!"
RF System X:
http://www.realityfactory.info/forum/vi ... f=9&t=3599
RF System X:
http://www.realityfactory.info/forum/vi ... f=9&t=3599
Re: opposite of IsKeyDown and self.key_pressed
Oh, never knew that. Thanks for the info.
Pain is only psychological.
-
- Posts: 335
- Joined: Sat Feb 09, 2008 5:47 pm
- Location: Lanzarote/Canary Islands/Spain
Re: opposite of IsKeyDown and self.key_pressed
Wow thanks to you to, graywolf
Re: opposite of IsKeyDown and self.key_pressed
You're welcome. If you have any more, questions, throw'em at me. I'll help if I can.
"So, what's the life of a programmer like?" "...Huh? What life?!"
RF System X:
http://www.realityfactory.info/forum/vi ... f=9&t=3599
RF System X:
http://www.realityfactory.info/forum/vi ... f=9&t=3599