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

eframe: Added App::raw_input_hook allows for the manipulation or filtering of raw input events #4008

Merged
merged 3 commits into from
Mar 12, 2024

Conversation

varphone
Copy link
Contributor

@varphone varphone commented Feb 8, 2024

What's New

  • eframe: Added App::raw_input_hook allows for the manipulation or filtering of raw input events
    A filter applied to raw input before [Self::update]
    This allows for the manipulation or filtering of input events before they are processed by egui.
    This can be used to exclude specific keyboard shortcuts, mouse events, etc.
    Additionally, it can be used to add custom keyboard or mouse events generated by a virtual keyboard.
  • examples: Added an example to demonstrates how to implement a custom virtual keyboard.
eframe-custom-keypad.webm

@varphone varphone force-pushed the feature/custom-keypad branch 5 times, most recently from cffa313 to 4a2a3b7 Compare February 11, 2024 04:14
Copy link
Owner

@emilk emilk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool example!

crates/eframe/src/epi.rs Outdated Show resolved Hide resolved
@emilk emilk added the eframe Relates to epi and eframe label Feb 16, 2024
@varphone varphone changed the title eframe: Added App::filter_raw_input_inplace allows for the manipulation or filtering of raw input events eframe: Added App::raw_input_hook allows for the manipulation or filtering of raw input events Mar 8, 2024
@emilk emilk merged commit 827fdef into emilk:master Mar 12, 2024
19 checks passed
emilk pushed a commit that referenced this pull request Jun 18, 2024
## What's new
* Extends @varphone's excellent `raw_input_hook` idea from
#4008 to `web/app_runner`.

## Details
Debugging this locally after my app's `raw_input_hook` wasn't being
called, I realized it's not in the code path of eframe's web runner,
only the native integration. Below is a toy example running on the web.


https://github.com/emilk/egui/assets/8173478/d470b7e6-d393-4ead-9745-3aafc72ae6bc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
eframe Relates to epi and eframe
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants