You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is the same key being held, but the API does not give any indication of that.
The proposed API would fix this, since KeyEvent gives access to the native virtual keycodes for that platform. They should not be relied upon to be consistent across platforms but to simply map to unique keys on that device. This would allow us to clearly see key down and release events despite the char/key changing.
Also you can call .chr() to get the actual char, or try to get the KeyCode. This would make existing code simpler too, since right now I have code like:
/// Filter these char events from being handled since we handle them/// using the key_up/key_down events./// Avoids duplicate processing of keyboard input events.pubstaticDISALLOWED_CHARS:&'static[char] = &['\r','\u{8}','\u{7f}','\t','\n'];/// These keycodes are handled via normal key_up/key_down events./// Anything in this list must be disallowed char events.pubstaticALLOWED_KEYCODES:&'static[KeyCode] = &[KeyCode::Left,KeyCode::Right,KeyCode::Up,KeyCode::Down,KeyCode::Enter,KeyCode::Kp0,KeyCode::Kp1,KeyCode::Kp2,KeyCode::Kp3,KeyCode::Kp4,KeyCode::Kp5,KeyCode::Kp6,KeyCode::Kp7,KeyCode::Kp8,KeyCode::Kp9,KeyCode::KpDecimal,KeyCode::KpEnter,KeyCode::Delete,KeyCode::Backspace,KeyCode::Home,KeyCode::End,];
With this change, I can simply handle all key events in one place directly rather than having to deal with crossover from both key_down(KeyCode::A) and char_event('A').
The text was updated successfully, but these errors were encountered:
Proposed API:
KeyEvent then has this API: https://doc.qt.io/qt-6/qkeyevent.html
KeyPhase has Press, Release, Canceled
Check this log:
This is the same key being held, but the API does not give any indication of that.
The proposed API would fix this, since KeyEvent gives access to the native virtual keycodes for that platform. They should not be relied upon to be consistent across platforms but to simply map to unique keys on that device. This would allow us to clearly see key down and release events despite the char/key changing.
Also you can call .chr() to get the actual char, or try to get the KeyCode. This would make existing code simpler too, since right now I have code like:
With this change, I can simply handle all key events in one place directly rather than having to deal with crossover from both key_down(KeyCode::A) and char_event('A').
The text was updated successfully, but these errors were encountered: