Skip to content

Commit 0626132

Browse files
author
Fredrik Orderud
committed
moufiltr: Mirror mouse movement
Make the driver more interesting by mirroring mouse events, so that left movement becomes right, up movement becomes down, and so on.
1 parent c73af47 commit 0626132

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

input/moufiltr/moufiltr.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,12 @@ Return Value:
487487
PDEVICE_EXTENSION devExt;
488488
WDFDEVICE hDevice;
489489

490+
// mirror mouse events in queue
491+
for (MOUSE_INPUT_DATA* id = InputDataStart; id != InputDataEnd; ++id) {
492+
id->LastX = -id->LastX;
493+
id->LastY = -id->LastY;
494+
}
495+
490496
hDevice = WdfWdmDeviceGetWdfDeviceHandle(DeviceObject);
491497

492498
devExt = FilterGetData(hDevice);

0 commit comments

Comments
 (0)