From f0fc43428ed641fbeff0b38148443318058f6622 Mon Sep 17 00:00:00 2001 From: tosti007 Date: Wed, 20 Dec 2023 12:07:03 +0100 Subject: [PATCH] Allow getting the clipboard and allow_ime state Co-authored-by: Marijn Suijten --- crates/egui-winit/src/lib.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/crates/egui-winit/src/lib.rs b/crates/egui-winit/src/lib.rs index 3da3781e093..c416e658c63 100644 --- a/crates/egui-winit/src/lib.rs +++ b/crates/egui-winit/src/lib.rs @@ -172,6 +172,21 @@ impl State { self.egui_input.max_texture_side = Some(max_texture_side); } + /// Returns the used clipboard. + pub fn clipboard(&mut self) -> &mut clipboard::Clipboard { + &mut self.clipboard + } + + /// Returns [`false`] or the last value that [`Window::set_ime_allowed()`] was called with, used for debouncing. + pub fn allow_ime(&self) -> bool { + self.allow_ime + } + + /// Returns [`false`] or the last value that [`Window::set_ime_allowed()`] was called with, used for debouncing. + pub fn allow_ime_mut(&mut self) -> &mut bool { + &mut self.allow_ime + } + #[inline] pub fn egui_ctx(&self) -> &egui::Context { &self.egui_ctx