Hi.
I made a simple chatting program, and it gets key inputs using IEventReceiver.
When event.KeyInput.Key is irr::KEY_RETURN and event.KeyInput.PressDown is set, the program send chat message to sever and clear the edit box's text.
And it checks this event while dev->run() which of FPS is set to 30 FPS.
Also when the chat message is empty, it shows a messagebox that should be something on the chat message edit box.
However, the program gets user's Enter Key event so fast, so even I put some message on edit box and input Enter Key, it tries message at least twice so that the first message sent and the second cleared-message isn't sent, which shows a "edit box is empty!" message box.
Why does IEventReceiver get user's key input so fast?
And is there any method to control this speed so that I can get user's input not so badly fast?
Please help. Thanks in advance
EventReceive catches events so fast
EventReceive catches events so fast
From Seoul, South Korea
-
hybrid
- Admin
- Posts: 14144
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Re: EventReceive catches events so fast
The event is only sent once, and key repeat is not that fast that it would occur on a single key hit. Maybe you just check the key state? In that case, you might get more than one frame with state key pressed. Maybe show your code?