Skip to content

Commit

Permalink
fix: account for modifiers in key text
Browse files Browse the repository at this point in the history
  • Loading branch information
wash2 committed Feb 5, 2024
1 parent e14e8e2 commit 3dca7f1
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions winit/src/conversion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
//!
//! [`winit`]: https://github.com/rust-windowing/winit
//! [`iced_runtime`]: https://github.com/iced-rs/iced/tree/0.10/runtime
use iced_graphics::core::SmolStr;
use winit::platform::modifier_supplement::KeyEventExtModifierSupplement;

Check failure on line 6 in winit/src/conversion.rs

View workflow job for this annotation

GitHub Actions / wasm

unresolved import `winit::platform::modifier_supplement`

use crate::core::keyboard;
use crate::core::mouse;
use crate::core::touch;
Expand Down Expand Up @@ -195,17 +198,16 @@ pub fn window_event(
}))
}

Check failure on line 199 in winit/src/conversion.rs

View workflow job for this annotation

GitHub Actions / all

Diff in /home/runner/work/iced/iced/winit/src/conversion.rs
},
WindowEvent::KeyboardInput {
event:
winit::event::KeyEvent {
logical_key,
state,
text,
location,
..
},
..
} => Some(Event::Keyboard({
WindowEvent::KeyboardInput { event, .. } => Some(Event::Keyboard({
let text_with_modifiers = event
.text_with_all_modifiers()

Check failure on line 203 in winit/src/conversion.rs

View workflow job for this annotation

GitHub Actions / wasm

no method named `text_with_all_modifiers` found for struct `KeyEvent` in the current scope
.map(SmolStr::new);
let winit::event::KeyEvent {
logical_key,
state,
location,
..
} = event;
let key = key(logical_key);
let modifiers = self::modifiers(modifiers);

Expand All @@ -228,7 +230,7 @@ pub fn window_event(
key,
modifiers,
location,
text,
text: text_with_modifiers,
}
}
winit::event::ElementState::Released => {
Expand Down

0 comments on commit 3dca7f1

Please sign in to comment.