From 35c0551ffae7ca1a393ba190e564092231727c1c Mon Sep 17 00:00:00 2001 From: Sett17 Date: Mon, 7 Aug 2023 02:21:46 +0200 Subject: [PATCH] fix(SynthPointer): Fix issue with penFlags not being set correctly in HoverMove and ContactMove functions The penFlags in the HoverMove and ContactMove functions were not being set correctly when the button was pressed. This resulted in incorrect behavior when using a pen device. The issue has been fixed by updating the assignment of penFlags to properly handle the button press condition. --- SynthPointer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SynthPointer.c b/SynthPointer.c index 425843b..47cc13c 100644 --- a/SynthPointer.c +++ b/SynthPointer.c @@ -51,7 +51,7 @@ void HoverMove(HSYNTHETICPOINTERDEVICE device, POINTER_TYPE_INFO *info, float x, info->penInfo.pointerInfo.ptPixelLocation.x = global.x; info->penInfo.pointerInfo.ptPixelLocation.y = global.y; info->penInfo.pointerInfo.pointerFlags = PEN_HOVER; - info->penInfo.penFlags |= (buttonPressed) ? PEN_FLAG_BARREL : 0; + info->penInfo.penFlags = (buttonPressed) ? PEN_FLAG_BARREL : PEN_FLAG_NONE; _injectPointer(device, info); } @@ -71,7 +71,7 @@ void ContactMove(HSYNTHETICPOINTERDEVICE device, POINTER_TYPE_INFO *info, float info->penInfo.pointerInfo.ptPixelLocation.x = global.x; info->penInfo.pointerInfo.ptPixelLocation.y = global.y; info->penInfo.pointerInfo.pointerFlags = PEN_CONTACT; - info->penInfo.penFlags |= (buttonPressed) ? PEN_FLAG_BARREL : 0; + info->penInfo.penFlags = (buttonPressed) ? PEN_FLAG_BARREL : PEN_FLAG_NONE; info->penInfo.penMask = PEN_MASK_PRESSURE; info->penInfo.pressure = pressure;