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.
This commit is contained in:
aiongg
2026-10-20 22:07:10 +00:00
parent 77cd7118ee
commit 3a8ea8d9ad
+3 -4
View File
@@ -39,12 +39,11 @@ pub fn install_windows() -> Option<photocraft_tablet::windows::Monitor> {
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<photocraft_ui_egui::RightButtonDownFn> {
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"))]