-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Implement Copy, Cut, Paste and others in EventFilter #5634
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Preview available at https://egui-pr-preview.github.io/pr/5634-patch159 |
+1 I need that so badly - you can't imagine. I've 2 non trivial UIs and need to manage these events on APP level - esp. because I can remap commands in my Apps. One of these is a multi window drawing tool… thanks for working on that. Unfortunately egui has gotten too big and that patch seems to be forgotton :(. Unfortunately I've a large set of libraries that use egui, otherwise I would just take your patch to fix my issue. But if it's not included soon I need to fork all libraries and use my fork … |
So to understand this correctly, this is needed so you can handle the events globally, but widgets can override this and have their own behavior if focussed? Or is it only needed to tell egui not to handle certain events? |
This is about turning off a specific event in TextEdit. |
@@ -1198,55 +1198,181 @@ impl From<u32> for TouchId { | |||
/// Any events not covered by the filter are given to the widget, but are not exclusive. | |||
#[derive(Clone, Copy, Debug)] | |||
pub struct EventFilter { | |||
/// If `true`, pressing tab will act on the widget, | |||
/// and NOT move focus away from the focused widget. | |||
/// If `true`, a copy action will be handled by the widget. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be simpler and more powerful as a callback
Implement Copy, Cut, Paste and others in EventFilter
copied_text
#5540copied_text
function maintained incopy_text()
until deletion #5553It seems like it would be better to make it work if true and not work if false, even if it's
_focus
, but for now, I'll keep it as is.