Skip to content

Commit

Permalink
fix(SynthPointer): Fix issue with penFlags not being set correctly in…
Browse files Browse the repository at this point in the history
… 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.
  • Loading branch information
dikkadev committed Aug 7, 2023
1 parent 373a509 commit 35c0551
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions SynthPointer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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;

Expand Down

0 comments on commit 35c0551

Please sign in to comment.