From 8607fc51d22c5999ff0324be5e7c46ae3b2ae756 Mon Sep 17 00:00:00 2001 From: Jonathan Johnson Date: Wed, 18 Oct 2023 16:07:26 -0700 Subject: [PATCH] Enabling IME --- src/widgets/input.rs | 8 ++++++++ src/window.rs | 9 +++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/widgets/input.rs b/src/widgets/input.rs index 6fc272e..253f496 100644 --- a/src/widgets/input.rs +++ b/src/widgets/input.rs @@ -161,6 +161,14 @@ impl Widget for Input { (_, _) => UNHANDLED, } } + + fn focus(&mut self, context: &mut crate::context::Context<'_, '_>) { + context.set_ime_allowed(true); + } + + fn blur(&mut self, context: &mut crate::context::Context<'_, '_>) { + context.set_ime_allowed(false); + } } struct LiveEditor { diff --git a/src/window.rs b/src/window.rs index 40c143e..6c718f0 100644 --- a/src/window.rs +++ b/src/window.rs @@ -269,12 +269,9 @@ where // fn modifiers_changed(&mut self, window: kludgine::app::Window<'_, ()>) {} - // fn ime( - // &mut self, - // window: kludgine::app::Window<'_, ()>, - // ime: kludgine::app::winit::event::Ime, - // ) { - // } + fn ime(&mut self, mut window: RunningWindow<'_>, ime: kludgine::app::winit::event::Ime) { + dbg!(ime); + } fn cursor_moved( &mut self,