-
-
Notifications
You must be signed in to change notification settings - Fork 980
Desktop: Mac fix keyboard input #3371
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
base: master
Are you sure you want to change the base?
Conversation
| ), | ||
| winit::keyboard::Key::Character(str) => { | ||
| let char = str.chars().next().unwrap_or('\0'); | ||
| let (named_key, character) = match &event.key_without_modifiers { |
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.
like i wrote on discord i don't think you can do this at this high level. This breaks @ € and similar special characters for text input.
That you have to translate this to cef events of course complicates this, but with a pure winit app i would only check against key_without_modifiers in the code for shortcuts, while the text input code still uses the regular input.
| self.cef_modifiers(&winit::keyboard::KeyLocation::Standard, false) | ||
| } | ||
|
|
||
| fn is_unmodified(&self) -> bool { |
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.
not a maintainer, but from the function name i thought this was about modifications since the last event or frame. Not that no modifier keys are pressed.
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.
Good point I will think about that. Was thinking about modifiers to much.
| char_key_event.native_key_code = native_key_code; | ||
| char_key_event.windows_key_code = buf[0] as i32; | ||
| char_key_event.character = buf[0]; | ||
| char_key_event.unmodified_character = buf[0]; |
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.
why do you set the both of character and unmodified_character to the same? buf is the unmodified char correct?
and some other changes see commit messages
Spend some time to understand why the following is necessary by digging though cef code but wasn't able to get it.
the texture import fix is only for mac.
they changed something about that while copying that code from us.
see tauri-apps/cef-rs#272 for details.