8000 Implement Copy, Cut, Paste and others in EventFilter by rustbasic · Pull Request #5634 · emilk/egui · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Dismiss alert

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

rustbasic
Copy link
Contributor

Implement Copy, Cut, Paste and others in EventFilter

It 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.

Copy link

Preview available at https://egui-pr-preview.github.io/pr/5634-patch159
Note that it might take a couple seconds for the update to show up after the preview_build workflow has completed.

@mkrueger
Copy link
Contributor

+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.
This is a design flaw in egui - it's ok for small apps to let the ui lib handle that but not for big desktop 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 …

@lucasmerlin
Copy link
Collaborator

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?

@lucasmerlin lucasmerlin added egui feature New feature or request labels Feb 18, 2025
@rustbasic
Copy link
Contributor Author

This is about turning off a specific event in TextEdit.
Users can turn off unwanted events or handle the events that are turned off directly.< 8000 /p>

@@ -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.
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
egui feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0