keyboard latency & feature request

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
corban
Posts: 35
Joined: Fri Nov 14, 2003 10:36 am
Contact:

keyboard latency & feature request

Post by corban »

hi there,

just started to play around with irrlicht the last days (well, nights 8) ) and already got my own camera movement running, irrlicht has a good object model indeed, no overhead. so on to my questions:

i noticed a small latency when receiving keyboard events: when a key is pressed, there is one event fired immediately but when the key stays pressed, the next events take some time (i presume 100ms or so) to occur. can i do anything against that?

i like the rotate**By methods of vector3d, cause one does not need to bother vector maths to simply rotate round a (local) centre. could it be possible to add a method for local movement (move relative to the objects coordinate system)?

greets,
corban
DarkWhoppy
Posts: 386
Joined: Thu Sep 25, 2003 12:43 pm
Contact:

Post by DarkWhoppy »

I've had that same problem with keypress... its like "TAP...................TAPTAPTAPTAPTAPTAPTAPTAPTAPTAP etc..." when holding the key down. That Raptor demo is extremely smooth, nice work on that demo 8)
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Re: keyboard latency & feature request

Post by niko »

corban wrote:i noticed a small latency when receiving keyboard events: when a key is pressed, there is one event fired immediately but when the key stays pressed, the next events take some time (i presume 100ms or so) to occur. can i do anything against that?
Hi, I fixed the problem with the keyboard in version 0.4.2 I hope I'll release it soon. With linux, there should be no such problem.

About the vector rotation: Yes, why not. But until I've implemented this, you could add it temporarily by yourself, just change the vector3d.h file, should not be a problem.
saigumi
Posts: 921
Joined: Fri Aug 22, 2003 11:31 am
Location: St. Louis, MO USA
Contact:

Post by saigumi »

I don't believe it is a problem. It's how your keyboard works and it's called the typematic rate.

For Windows, check the control panel->keyboard. There is an option for repeat delay as well as Repeat Rate.

What you want is to check for a state. If the key is down, set the state. If the state is on, move the object.

When the key is up, turn off the state. If the state is off, don't move the object.
Crud, how do I do this again?
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

This bug only appears if you have very low frames per second. So if you have a fast Geforce5 or whatever, you'll never get this problem, but people like me or corban do. It's just a problem with the while(engine->run() loop, and how I implemented the windows message handling. In vresion 0.4.2 input messages are simply processed faster.
DarkWhoppy
Posts: 386
Joined: Thu Sep 25, 2003 12:43 pm
Contact:

Post by DarkWhoppy »

Glad to hear this will/is fixed 8) A few people have... beta tested something i'm working on and mentioned the keyboard events going slow... :twisted:
Post Reply