Input is not working for me

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
Pilotze
Posts: 19
Joined: Tue Aug 24, 2004 1:33 pm
Contact:

Input is not working for me

Post by Pilotze »

Hey,
I've an odd Problem.I tried to put some
movement to my objects , code :

Code: Select all

if (event.EventType == irr::EET_KEY_INPUT_EVENT)
	
	{
		vector3df v = ply.Pnode->getPosition();
		
	switch(event.KeyInput.Key)
		{
		
		case KEY_KEY_W:
			{
			   v.Y += 2.0f;	
			   ply.Pnode->setPosition(v);
			}
		case KEY_KEY_S:
			{
			   v.Y -= 2.0f;	
			   ply.Pnode->setPosition(v);
			}
		case KEY_KEY_D:
			{
			   v.X -= 2.0f;	
			   ply.Pnode->setPosition(v);
			}
		case KEY_KEY_A:
			{
			   v.X += 2.0f;	
			   ply.Pnode->setPosition(v);
			}
		
	
		}

	}
}
But just the Keys 'A' and 'S' are working
when I compile my project.

Does anyone have an idea?
Das war jetzt erstmal der letzte fürs erste
saigumi
Posts: 921
Joined: Fri Aug 22, 2003 11:31 am
Location: St. Louis, MO USA
Contact:

Post by saigumi »

In C++ you need to break; the end of each case.
Crud, how do I do this again?
Pilotze
Posts: 19
Joined: Tue Aug 24, 2004 1:33 pm
Contact:

Post by Pilotze »

thx ;)
THat's why I posted it in Beginners ...^^
Das war jetzt erstmal der letzte fürs erste
bal
Posts: 829
Joined: Fri Jun 18, 2004 5:19 pm
Location: Geluwe, Belgium

Post by bal »

And isn't return true; needed as well?
General Tools List
General FAQ
System: AMD Barton 2600+, 512MB, 9600XT 256MB, WinXP + FC3
Midnight
Posts: 1772
Joined: Fri Jul 02, 2004 2:37 pm
Location: Wonderland

Post by Midnight »

bal wrote:And isn't return true; needed as well?
far as this noob knows not always but yes sometimes.
Pilotze
Posts: 19
Joined: Tue Aug 24, 2004 1:33 pm
Contact:

Post by Pilotze »

...well I just forgot about it , alright?
This happens to the best of us...I knew
it was something simple , that's why
I posted it here...
Das war jetzt erstmal der letzte fürs erste
Post Reply