keyboard

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
Draco
Posts: 14
Joined: Sat Mar 13, 2004 8:55 pm

keyboard

Post by Draco »

is there a way to manage keyboard input without using the event receiver?
Caecus
Posts: 36
Joined: Fri Aug 22, 2003 6:33 am
Location: California, USA

Post by Caecus »

Unfortunately I don't think it can be done easily. A GetKeyState function was one of the things on the old request list... I don't think it ever got added tho
Draco
Posts: 14
Joined: Sat Mar 13, 2004 8:55 pm

Post by Draco »

that sucks. Do you know if I can use C's native functions to get keyboard input inside of main()?
Caecus
Posts: 36
Joined: Fri Aug 22, 2003 6:33 am
Location: California, USA

Post by Caecus »

No generally I use GetAsyncKeyState, however that is a Win32 function so your limiting you platform.

A clean way to do this is use an event reciever and an array of bools to track the status of all the keys.

Then in main you can just do if (keys[VK_UP] == true)
rt
Posts: 150
Joined: Sun Nov 30, 2003 6:54 am
Location: canada
Contact:

Re: keyboard

Post by rt »

Draco wrote:is there a way to manage keyboard input without using the event receiver?
What you (or someone) needs to do is write a wrapper class that will have functions like isKeyPressed(keyID), getKeyState(keyID), as well as being able to bind keys to functions - bindKey(keyID, fuction_name). I already have this in another project i'm working on, and plan to do it for irrlicht once i start to work harder on my irrlicht project.... but if someone want to do it first that'd be great :P
Post Reply