diff --git a/crates/ui-egui/src/present/input.rs b/crates/ui-egui/src/present/input.rs index bfebd4b11..b8e94a22c 100644 --- a/crates/ui-egui/src/present/input.rs +++ b/crates/ui-egui/src/present/input.rs @@ -162,13 +162,16 @@ fn fire_pads(p: &mut Presenter, doc: &Document, root: NodeId, pads: &[String], n /// player takes the keyboard; `pane`: it plays in the preview pane (which always fits). pub(super) struct InputMode { pub over_area: bool, + /// Presses reach the prototype: false in the presenter's comment mode, where a click places a + /// comment (hover and the wheel still work). + pub clicks: bool, pub keys_on: bool, pub pane: bool, pub now: f64, } pub(super) fn input(p: &mut Presenter, ctx: &egui::Context, l: &Layout, mode: InputMode) { - let InputMode { over_area, keys_on, pane, now } = mode; + let InputMode { over_area, clicks, keys_on, pane, now } = mode; let (pos, pressed, released, down, wheel, velocity, dt, keys) = ctx.input(|i| { let keys: Vec<(egui::Key, egui::Modifiers)> = i .events @@ -190,6 +193,7 @@ pub(super) fn input(p: &mut Presenter, ctx: &egui::Context, l: &Layout, mode: In ) }); let keys = if keys_on { keys } else { Vec::new() }; + let pressed = pressed && clicks; // Controller buttons pressed while a link notice shows are dropped, as keys are. let pads = std::mem::take(&mut p.pads); let pads = if p.link_notice.is_none() { pads } else { Vec::new() }; diff --git a/crates/ui-egui/src/present/player.rs b/crates/ui-egui/src/present/player.rs index ff821620a..5e79cdbe2 100644 --- a/crates/ui-egui/src/present/player.rs +++ b/crates/ui-egui/src/present/player.rs @@ -64,7 +64,13 @@ pub(super) fn player(p: &mut Presenter, ui: &mut Ui, rect: Rect, now: f64, chrom p, &ctx, &l, - InputMode { over_area: over && p.link_notice.is_none() && !(p.view.comments && !chrome.pane), keys_on: keys, pane: chrome.pane, now }, + InputMode { + over_area: over && p.link_notice.is_none(), + clicks: !(p.view.comments && !chrome.pane), + keys_on: keys, + pane: chrome.pane, + now, + }, ); } else { p.pads.clear();