Skip to content

Commit

Permalink
Allow getting the clipboard and allow_ime state
Browse files Browse the repository at this point in the history
Co-authored-by: Marijn Suijten <[email protected]>
  • Loading branch information
tosti007 and MarijnS95 committed Dec 25, 2023
1 parent 5b591d2 commit f0fc434
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions crates/egui-winit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f0fc434

Please sign in to comment.