From e819c2390bad76e811265245bd5fab63fc30a8b2 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Fri, 15 Dec 2023 13:15:44 +0100 Subject: Update `winit` to `0.29.4` --- widget/src/text_editor.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'widget/src/text_editor.rs') diff --git a/widget/src/text_editor.rs b/widget/src/text_editor.rs index a2a186f0..3c0a1806 100644 --- a/widget/src/text_editor.rs +++ b/widget/src/text_editor.rs @@ -649,6 +649,7 @@ impl Update { keyboard::Event::KeyPressed { key_code, modifiers, + text, } if state.is_focused => { if let Some(motion) = motion(key_code) { let motion = @@ -678,12 +679,15 @@ impl Update { { Some(Self::Paste) } - _ => None, + _ => { + let text = text?; + + edit(Edit::Insert( + text.chars().next().unwrap_or_default(), + )) + } } } - keyboard::Event::CharacterReceived(c) if state.is_focused => { - edit(Edit::Insert(c)) - } _ => None, }, _ => None, -- cgit