-
Notifications
You must be signed in to change notification settings - Fork 351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Characters sent to input text are being repeated #776
Comments
Tried a fix and seems to work, WindowEvent::KeyboardInput { ref event, .. } => {
if let Some(txt) = &event.text {
if event.state.is_pressed() {
for ch in txt.chars() {
if ch != '\u{7f}' {
io.add_input_character(ch)
}
}
}
} |
Helyos96
added a commit
to Helyos96/Lightning
that referenced
this issue
May 10, 2024
Note that due to a bug in imgui-rs 0.12, characters repeat on text input.. imgui-rs/imgui-rs#776
Helyos96
added a commit
to Helyos96/Lightning
that referenced
this issue
May 10, 2024
Note that due to a bug in imgui-rs 0.12, characters repeat on text input. imgui-rs/imgui-rs#776
Happening on X11 here, but Windows is fine. |
nit: in the proposed fix, the is pressed check should be done before extracting the event text. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
A clear and concise description of what the bug is.
On the main branch, when typing into an input text, the characters are being repeated.
Env
Other information
Add related issues, suggestions about how to fix, any other context here.
It looks like the issues is because in winit 0.29.0 they removed the ReceivedCharacter event, so now imgui-winit-support calls
add_input_character
inside of KeyboardInput.I think the problem is that the KeyboardInput event is emitted twice (press/release) which means
add_input_character
is going to be called twice.The text was updated successfully, but these errors were encountered: