Skip to content

Commit

Permalink
fix: allow pen to hover over (#2524)
Browse files Browse the repository at this point in the history
Even if the pen is not touching the surface, the move events should be
dispatched.
  • Loading branch information
sadym-chromium authored Aug 22, 2024
1 parent 1bc7af5 commit 79feac8
Showing 1 changed file with 21 additions and 23 deletions.
44 changes: 21 additions & 23 deletions src/bidiMapper/modules/input/ActionDispatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -410,29 +410,27 @@ export class ActionDispatcher {
);
break;
case Input.PointerType.Pen:
if (source.pressed.size !== 0) {
// TODO: Implement width and height when available.
await this.#context.cdpTarget.cdpClient.sendCommand(
'Input.dispatchMouseEvent',
{
type: 'mouseMoved',
x,
y,
modifiers,
clickCount: 0,
button: getCdpButton(
source.pressed.values().next().value ?? 5
),
buttons: source.buttons,
pointerType,
tangentialPressure,
tiltX,
tiltY,
twist,
force: pressure,
}
);
}
// Even if the pressed size is 0, we still need to send the event, as pen can
// hover over.
// TODO: Implement width and height when available.
await this.#context.cdpTarget.cdpClient.sendCommand(
'Input.dispatchMouseEvent',
{
type: 'mouseMoved',
x,
y,
modifiers,
clickCount: 0,
button: getCdpButton(source.pressed.values().next().value ?? 5),
buttons: source.buttons,
pointerType,
tangentialPressure,
tiltX,
tiltY,
twist,
force: pressure,
}
);
break;
case Input.PointerType.Touch:
if (source.pressed.size !== 0) {
Expand Down

0 comments on commit 79feac8

Please sign in to comment.