Tutorial 7: Checking for KeyPressed

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
so1odo1o
Posts: 32
Joined: Sat Apr 03, 2010 10:29 am

Tutorial 7: Checking for KeyPressed

Post 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.
greenya
Posts: 1012
Joined: Sun Jan 21, 2007 1:46 pm
Location: Ukraine
Contact:

Post by greenya »

Look into 04.Movement tutorial.
It handles some user input using MyEventReceiver class derived from IEventReceiver -- this is the key.
so1odo1o
Posts: 32
Joined: Sat Apr 03, 2010 10:29 am

Post 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?
kamikaze942
Posts: 52
Joined: Wed Mar 03, 2010 7:11 pm

Post 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
Kamikaze
Post Reply