Skip to content

Commit 0b280de

Browse files
owen-dhacknus
authored andcommitted
Make sure to call raw_input_hook on web (emilk#4646)
## What's new * Extends @varphone's excellent `raw_input_hook` idea from emilk#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
1 parent f75934e commit 0b280de

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

crates/eframe/src/web/app_runner.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,9 @@ impl AppRunner {
188188
/// The result can be painted later with a call to [`Self::run_and_paint`] or [`Self::paint`].
189189
pub fn logic(&mut self) {
190190
let canvas_size = super::canvas_size_in_points(self.canvas(), self.egui_ctx());
191-
let raw_input = self.input.new_frame(canvas_size);
191+
let mut raw_input = self.input.new_frame(canvas_size);
192+
193+
self.app.raw_input_hook(&self.egui_ctx, &mut raw_input);
192194

193195
let full_output = self.egui_ctx.run(raw_input, |egui_ctx| {
194196
self.app.update(egui_ctx, &mut self.frame);

0 commit comments

Comments
 (0)