Merge pull request #2991 from bbb651/keyboard-event-repeat
Add `repeat` field to `keyboard::Event::KeyPressed`
This commit is contained in:
commit
6aba73a13f
3 changed files with 6 additions and 0 deletions
|
|
@ -29,6 +29,9 @@ pub enum Event {
|
|||
|
||||
/// The text produced by the key press, if any.
|
||||
text: Option<SmolStr>,
|
||||
|
||||
/// Whether the event was the result of key repeat.
|
||||
repeat: bool,
|
||||
},
|
||||
|
||||
/// A keyboard key was released.
|
||||
|
|
|
|||
|
|
@ -381,6 +381,7 @@ pub fn press_key(
|
|||
),
|
||||
location: keyboard::Location::Standard,
|
||||
modifiers: keyboard::Modifiers::default(),
|
||||
repeat: false,
|
||||
text,
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -249,6 +249,7 @@ pub fn window_event(
|
|||
location,
|
||||
logical_key,
|
||||
physical_key,
|
||||
repeat,
|
||||
..
|
||||
} = event;
|
||||
|
||||
|
|
@ -279,6 +280,7 @@ pub fn window_event(
|
|||
modifiers,
|
||||
location,
|
||||
text,
|
||||
repeat,
|
||||
}
|
||||
}
|
||||
winit::event::ElementState::Released => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue