- sacchin-theforge
- Posts: 1
- Joined:
Issue with KeyDown repeat
Hi,
How exactly should we be handling repeat events for special keys like backspace and delete? I could not seem to find anything regarding this in the docs. For text input calling Char seems to automatically repeat after a short delay, but for KeyDown calls such as backspace / delete it does not automatically repeat. Should we be calling KeyDown every frame ourselves with a custom delay?
Thanks.
How exactly should we be handling repeat events for special keys like backspace and delete? I could not seem to find anything regarding this in the docs. For text input calling Char seems to automatically repeat after a short delay, but for KeyDown calls such as backspace / delete it does not automatically repeat. Should we be calling KeyDown every frame ourselves with a custom delay?
Thanks.
Re: Issue with KeyDown repeat
Because the first implementation of Noesis was for Windows, the API for input events in views was based on that. If you have doubts about specific details, I recommend debugging our Win32Display with the HelloWorld example, to analyze how events are being sent to the View.
But yes, you need to invoke "KeyDown" and "Char" repeatedly. I checked right now with the BackSpace key.
But yes, you need to invoke "KeyDown" and "Char" repeatedly. I checked right now with the BackSpace key.
Code: Select all
/// Notifies that a key was initially pressed or repeatedly pressed
/// Returns true if event was handled
virtual bool KeyDown(Key key) = 0;
/// Notifies that a key was translated to the corresponding unicode character.
/// If a key is repeatedly pressed, its corresponding 'Char' event is sent again.
/// 'Char' messages are expected to be sent between the corresponding 'Down' and 'Up' events:
/// - KeyDown
/// - Char
/// - KeyUp
/// Returns true if event was handled
virtual bool Char(uint32_t ch) = 0;
Who is online
Users browsing this forum: No registered users and 21 guests