Skip to content

Conversation

@EvilLary
Copy link
Contributor

rn only ascii characters are accepted, and others return Key::Unknown. This removes the check and uses Keysym::key_char() to obtain the character.

Also remvoed match cases for t, e, r, g, b, y, o, p, w, k, z as key_char() already handles them, unless if I'm missing something.

I've only tested with Arabic, but I'd assume it will for other layouts
image

@EvilLary
Copy link
Contributor Author

Should I also remove the match cases for - , + , = , _ or are they required for some special cases, from my testing they worked fine without these cases

Key::Unknown
}
}
_ => keysym.key_char().map_or(Key::Unknown, Key::Char),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enter/Tab will insert control characters this way? Might need to add explicit handling for them?

Might need the Keysym::Return | Keysym::KP_Enter => Key::Return and Keysym::Tab | Keysym::KP_Tab => Key::Tab

Copy link
Contributor Author

@EvilLary EvilLary Dec 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated and added the rest of functions key and removed match case for 0

@devmobasa
Copy link
Owner

Should I also remove the match cases for - , + , = , _ or are they required for some special cases, from my testing they worked fine without these cases

I think those are covered by key_char() and are safe to remove?

Thanks for PR!

@devmobasa devmobasa merged commit c089516 into devmobasa:main Dec 31, 2025
1 check passed
@EvilLary EvilLary deleted the nonascii branch December 31, 2025 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants