diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index e9adea67..940dbe82 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -7421,7 +7421,7 @@ if test "$enable_wintab32_improvements" -eq 1; then patch_apply wintab32-improvements/0003-winex11-Handle-negative-orAltitude-values.patch patch_apply wintab32-improvements/0004-winex11.drv-Support-multiplex-categories-WTI_DSCTXS-.patch patch_apply wintab32-improvements/0005-winex11-Support-WTI_STATUS-in-WTInfo.patch - patch_apply wintab32-improvements/0006-wintab32-Scale-NormalPressure-before-sending-to-to-c.patch + patch_apply wintab32-improvements/0006-wintab32-Scale-NormalPressure-before-sending-to-the-.patch patch_apply wintab32-improvements/0007-wintab32-tests-Initial-interactive-test.patch ( printf '%s\n' '+ { "Eriks Dobelis", "winex11: Implement PK_CHANGE for wintab.", 1 },'; diff --git a/patches/wintab32-improvements/0006-wintab32-Scale-NormalPressure-before-sending-to-to-c.patch b/patches/wintab32-improvements/0006-wintab32-Scale-NormalPressure-before-sending-to-the-.patch similarity index 52% rename from patches/wintab32-improvements/0006-wintab32-Scale-NormalPressure-before-sending-to-to-c.patch rename to patches/wintab32-improvements/0006-wintab32-Scale-NormalPressure-before-sending-to-the-.patch index 490d1f03..9ee1937a 100644 --- a/patches/wintab32-improvements/0006-wintab32-Scale-NormalPressure-before-sending-to-to-c.patch +++ b/patches/wintab32-improvements/0006-wintab32-Scale-NormalPressure-before-sending-to-the-.patch @@ -1,17 +1,16 @@ -From dd5371720cce8910281a79d860d1fcb45acc1767 Mon Sep 17 00:00:00 2001 +From d4f6b48e80e18404bb3a48d5861f3e6998d179a8 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Wed, 3 Apr 2019 16:43:30 +1100 Subject: [PATCH] wintab32: Scale NormalPressure before sending to the client. We need to workout how to get valid Min/Max Pressure values that are the same value as windows. - --- - dlls/winex11.drv/wintab.c | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) + dlls/winex11.drv/wintab.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/dlls/winex11.drv/wintab.c b/dlls/winex11.drv/wintab.c -index 3517bd53cef..380562e9597 100644 +index 3517bd5..5e823e1 100644 --- a/dlls/winex11.drv/wintab.c +++ b/dlls/winex11.drv/wintab.c @@ -925,7 +925,11 @@ static BOOL motion_event( HWND hwnd, XEvent *event ) @@ -20,13 +19,26 @@ index 3517bd53cef..380562e9597 100644 } - gMsgPacket.pkNormalPressure = motion->axis_data[2]; + /* Scale the value sent from XInput 0-65536 -+ * Windows 0-1043 ++ * Windows 0-1023 + */ + gMsgPacket.pkNormalPressure = ((motion->axis_data[2] - gSysDevice.NPRESSURE.axMin) / -+ ((float)gSysDevice.NPRESSURE.axMax - gSysDevice.NPRESSURE.axMin)) * 1043; ++ ((float)gSysDevice.NPRESSURE.axMax - gSysDevice.NPRESSURE.axMin)) * 1023; gMsgPacket.pkButtons = get_button_state(curnum); gMsgPacket.pkChanged = get_changed_state(&gMsgPacket); SendMessageW(hwndTabletDefault,WT_PACKET,gMsgPacket.pkSerialNumber,(LPARAM)hwnd); +@@ -1009,7 +1013,11 @@ static BOOL proximity_event( HWND hwnd, XEvent *event ) + FIXME("Negative orAltitude detected\n"); + return FALSE; + } +- gMsgPacket.pkNormalPressure = proximity->axis_data[2]; ++ /* Scale the value sent from XInput 0-65536 ++ * Windows 0-1023 ++ */ ++ gMsgPacket.pkNormalPressure = ((proximity->axis_data[2] - gSysDevice.NPRESSURE.axMin) / ++ ((float)gSysDevice.NPRESSURE.axMax - gSysDevice.NPRESSURE.axMin)) * 1023; + gMsgPacket.pkButtons = get_button_state(curnum); + + /* FIXME: LPARAM loword is true when cursor entering context, false when leaving context -- -2.20.1 +1.9.1