Skip to content

Commit aff79bd

Browse files
committed
fixes #776 on imgui-rs
1 parent e915b8a commit aff79bd

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/lib.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,12 @@ impl WinitPlatform {
197197
io.add_key_event(Key::ModSuper, state.super_key());
198198
}
199199
WindowEvent::KeyboardInput { ref event, .. } => {
200-
if let Some(txt) = &event.text {
201-
for ch in txt.chars() {
202-
if ch != '\u{7f}' {
203-
io.add_input_character(ch)
200+
if event.state.is_pressed() {
201+
if let Some(txt) = &event.text {
202+
for ch in txt.chars() {
203+
if ch != '\u{7f}' {
204+
io.add_input_character(ch)
205+
}
204206
}
205207
}
206208
}

0 commit comments

Comments
 (0)