Skip to content

Conversation

@timon-schelling
Copy link
Member

@timon-schelling timon-schelling commented Nov 12, 2025

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.

#[cfg(not(target_os = "macos"))] // TODO: Understand why this is needed to avoid double keydown events on mac
host.send_key_event(Some(&key_event));

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.

),
winit::keyboard::Key::Character(str) => {
let char = str.chars().next().unwrap_or('\0');
let (named_key, character) = match &event.key_without_modifiers {
Copy link

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 {
Copy link

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.

Copy link
Member Author

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];
Copy link

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?

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.

3 participants