Page 1 of 1

Tutorial 7: Checking for KeyPressed

Posted: Thu May 13, 2010 10:09 am
by so1odo1o
I am playing around with Tutorial 7 and I want to add some logic when a certain key is press, for example the key 'Q'.

Since the tutorial added its own FPS Camera, how can I check when the 'Q' key is being pressed?

Thank you.

Posted: Thu May 13, 2010 11:19 am
by greenya
Look into 04.Movement tutorial.
It handles some user input using MyEventReceiver class derived from IEventReceiver -- this is the key.

Posted: Fri May 14, 2010 2:12 am
by so1odo1o
I don't really want to mess with the arrow keys if I am to overwrite EventReceiver. I am already using the FPSCamera. Will I have to rewrite all of that if I just want to set a custom key to do a certain thing?

Posted: Fri May 14, 2010 2:25 am
by kamikaze942
go to this thread, you will be able to use this to enable key presses. it has the .h and .cpp files.

http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=24508