From 5caf0ff5d6df2f112d4a6169554bf5e45346bf16 Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 1 Jan 2022 15:14:30 +0100 Subject: [PATCH] device: Correction to 0e9ea6706686ee810eea8171b96637b324763481 Fixes #1218 --- panda/src/device/winRawInputDevice.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panda/src/device/winRawInputDevice.cxx b/panda/src/device/winRawInputDevice.cxx index 8448b58da4..0e1eb937bf 100644 --- a/panda/src/device/winRawInputDevice.cxx +++ b/panda/src/device/winRawInputDevice.cxx @@ -702,7 +702,7 @@ process_report(PCHAR ptr, size_t size) { // Sign extend. int value = data[di].RawValue; if (value & idx._sign_bit) { - value = -(value & ~idx._sign_bit); + value -= (idx._sign_bit << 1); } axis_changed(idx._axis, value); } else {