Page 1 of 1

keyboard

Posted: Fri Mar 19, 2004 1:39 am
by Draco
is there a way to manage keyboard input without using the event receiver?

Posted: Fri Mar 19, 2004 2:00 am
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

Posted: Fri Mar 19, 2004 2:08 am
by Draco
that sucks. Do you know if I can use C's native functions to get keyboard input inside of main()?

Posted: Fri Mar 19, 2004 5:47 am
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)

Re: keyboard

Posted: Fri Mar 19, 2004 4:57 pm
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