Key release detection?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
souledgar
Posts: 5
Joined: Tue May 22, 2007 1:09 pm

Key release detection?

Post by souledgar »

Hi all,
Firstly, greetings! I am new to game development (not new to programming) and i have come seeking help! Hope we get along =)

Anyway here's my problem:
I'm in a project for school, and i need to develop a racing game.
What i need to know is if theres a function somewhere in Irrlicht that detects when the player releases the key, that mirrors GLUT's keyup function e.g. Press W to accelerate, let go and it stop accelerating.

I've checked the API and searched the forums but i can't seem to find what i need.

Yoroshiku onegaishimasu.
cuatro
Posts: 11
Joined: Tue May 08, 2007 2:29 am

Post by cuatro »

look at the irr::SEvent::KeyInput.PressedDown value.

also look in the tutorials to see how this is used.
souledgar
Posts: 5
Joined: Tue May 22, 2007 1:09 pm

Post by souledgar »

ah.. hmm. i've gone through the tutorials, or at least most of them.
is there an example of how i can implement something so that it happens the moment the key is released?

i currently rely on default:, which looks like a bad idea

edit: i now have a second problem: when i try to accelerate and turn at the same time, the moment i release the second key triggers the apparent release of the first key as well.

edit 2: nevermind. i discovered this. thanks anyway =D
souledgar
Posts: 5
Joined: Tue May 22, 2007 1:09 pm

Post by souledgar »

Sorry, but i have a problem with the solution i found on the how-to forums and i'm not supposed to ask questions there, and the thread is way old anyway.

my problem is that the when i press and hold.. "Turn-Right" for example, my vehicle turns for a microsecond, pauses, then continues turning. Is there a way to make it so that it turns without the microsecond pause?

code available on request
Dances
Posts: 454
Joined: Sat Jul 02, 2005 1:45 am
Location: Canada
Contact:

Post by Dances »

You need to go through that thread again. When bool keys is used properly you'll not have that problem. It has to do with your key repeat.... go about half way down and keless has a post about how to do it right... copy his code and follow his instructions. The first post of his the code doesn't quite work and the last post someone else made is A LOT of extra code -.-
Post Reply