Skip to content
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

Enable key repeat for non text keys #2387

Closed
mkrueger opened this issue Dec 5, 2022 · 3 comments · Fixed by #2389
Closed

Enable key repeat for non text keys #2387

mkrueger opened this issue Dec 5, 2022 · 3 comments · Fixed by #2389

Comments

@mkrueger
Copy link
Contributor

mkrueger commented Dec 5, 2022

I'm currently developing a terminal application using egui. I use a fragment shader to display the content and use it inside a ViewPort scroll area:

           let output = ScrollArea::vertical()
           .auto_shrink([false; 2])
           .stick_to_bottom(true)
           .show_viewport(ui, |ui, viewport| { …

            let events = ui.input().events.clone();
            for e in &events { …
            }

I need to handle the key events myself and it works quite well - however key repeats for the command keys Arrow/Backspace are not working - only the Text event does. I can't figure out how to detect key repeats the egui::Event::Key { key, pressed: true, modifiers } event is only once in the list.

Another issue is - can I disable the scroll drag in the ScrollArea somehow? It's interfering with my mouse selection in the control.

@emilk
Copy link
Owner

emilk commented Dec 5, 2022

Starting in #2334 (recently), key repeates are ignored. Perhaps this was a bad idea.

Another issue is - can I disable the scroll drag in the ScrollArea somehow? It's interfering with my mouse selection in the control.

See #2163

@mkrueger
Copy link
Contributor Author

mkrueger commented Dec 5, 2022

It's not a bad idea per se having events for key press and release without repeat does make sense.
But I would vote for maybe a KeyReceived event for the key repeats.

The agree that the frame based event system is a bit tricky. But I really, really need key repeats here :/ (however now I know where to patch that - thanks.)

ps. I really like the Composition events - I started my application with iced and they're completely missing dead key and IME scenarios - but the deal breaker is that egui allows me to use opengl controls thanks for that.

@mkrueger
Copy link
Contributor Author

mkrueger commented Dec 5, 2022

@emilk: Something like that would work #2389

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

Successfully merging a pull request may close this issue.

2 participants