From 3a8ea8d9addca0ee1214e2d73795d2900ddf413b Mon Sep 17 00:00:00 2001 From: aiongg Date: Tue, 20 Oct 2026 18:43:41 +0000 Subject: [PATCH] Integration: barrel check reads only the pen, not the global right button, for #6195 GetAsyncKeyState(VK_RBUTTON) reads the physical button system-wide: with swapped buttons a primary click read as right-down, and a right button held over another window counted too. --- apps/photocraft/src/tablet.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/photocraft/src/tablet.rs b/apps/photocraft/src/tablet.rs index bd9507f00b..19ba28996c 100644 --- a/apps/photocraft/src/tablet.rs +++ b/apps/photocraft/src/tablet.rs @@ -39,12 +39,11 @@ pub fn install_windows() -> Option { photocraft_tablet::windows::Monitor::install().map_err(|e| log::warn!("{e}")).ok() } -/// Physical right mouse button or stylus barrel button down check (Windows). +/// Stylus barrel button down check (Windows). The right mouse button is left to egui, which +/// reports the logical secondary button (swapped buttons included) for the app's own window only. #[cfg(target_os = "windows")] pub fn right_button_service() -> Option { - Some(Box::new(|| { - photocraft_tablet::windows::is_barrel_button_down() || winsafe::GetAsyncKeyState(winsafe::co::VK::RBUTTON) - })) + Some(Box::new(photocraft_tablet::windows::is_barrel_button_down)) } #[cfg(not(target_os = "windows"))]