-
Notifications
You must be signed in to change notification settings - Fork 120
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
Fix non-standard textbox behavior in Windows #489
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems reasonable, thanks! Using the text
field has been on my mental list of things to get around to, but I haven't been able to prioritise.
I've not tested the change myself yet. Will do so once review comments are handled.
Can you please apply: From d8f24005fb02dabb8b82837940fc2c192f480908 Mon Sep 17 00:00:00 2001
From: Daniel McNab <[email protected]>
Date: Tue, 6 Aug 2024 17:31:11 +0100
Subject: [PATCH] Remove the conditional for windows
---
masonry/src/text/edit.rs | 16 ++++------------
1 file changed, 4 insertions(+), 12 deletions(-)
diff --git a/masonry/src/text/edit.rs b/masonry/src/text/edit.rs
index bf4b28dd..50e41a11 100644
--- a/masonry/src/text/edit.rs
+++ b/masonry/src/text/edit.rs
@@ -190,18 +190,10 @@ impl<T: EditableText> TextEditor<T> {
Key::Character(c) => {
self.insert_text(event.text.as_ref().unwrap_or(c), ctx)
}
- Key::Unidentified(_) => {
- // Ensures conformance with native Windows behavior in case some
- // key event hook sets unidentifed key code and some text for pickup
- if cfg!(windows) {
- event
- .text
- .as_ref()
- .map_or(Handled::No, |c| self.insert_text(c, ctx))
- } else {
- Handled::No
- }
- }
+ Key::Unidentified(_) => match event.text.as_ref() {
+ Some(text) => self.insert_text(text, ctx),
+ None => Handled::No,
+ },
Key::Dead(d) => {
eprintln!("Got dead key {d:?}. Will handle");
Handled::No
--
2.45.2
Because you have chosen to create this PR from your default branch, I can't push to it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! We are aware that this code will still have some janky and unexpected behaviour, but it's good to close some holes, anyway.
No description provided.