mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-26 14:49:07 -04:00
@@ -59,6 +59,10 @@ crate = "android-activity"
|
||||
allow-globs = ["ci/*", "githooks/*"]
|
||||
crate = "zerocopy"
|
||||
|
||||
[[bans.build.bypass]]
|
||||
allow-globs = ["cherry-pick-stable.sh"]
|
||||
crate = "libc"
|
||||
|
||||
[[bans.build.bypass]]
|
||||
allow-globs = ["freetype2/*"]
|
||||
crate = "freetype-sys"
|
||||
|
||||
@@ -129,20 +129,23 @@ impl Dispatch<WlKeyboard, KeyboardData, WinitState> for WinitState {
|
||||
state.events_sink.push_window_event(WindowEvent::Focused(false), window_id);
|
||||
}
|
||||
},
|
||||
WlKeyboardEvent::Key { key, state: WEnum::Value(WlKeyState::Pressed), .. } => {
|
||||
WlKeyboardEvent::Key { key, state: WEnum::Value(key_state), .. }
|
||||
if matches!(key_state, WlKeyState::Repeated | WlKeyState::Pressed) =>
|
||||
{
|
||||
let key = key + 8;
|
||||
|
||||
key_input(
|
||||
keyboard_state,
|
||||
&mut state.events_sink,
|
||||
data,
|
||||
key,
|
||||
ElementState::Pressed,
|
||||
false,
|
||||
key_state == WlKeyState::Repeated,
|
||||
);
|
||||
|
||||
let delay = match keyboard_state.repeat_info {
|
||||
RepeatInfo::Repeat { delay, .. } => delay,
|
||||
// When compositor handles repeat, and thus we have `repeat = true`, we have
|
||||
// repeat on our side disabled, if it's not true, it's a compositor bug.
|
||||
RepeatInfo::Disable => return,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user