From 9716ee3e47b485633773645c1060cbe884d3adac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Tue, 11 May 2010 18:32:16 +0000 Subject: [PATCH] For Intuos3, use an additional bit from another data bucket. This is what the Linux driver does, thanks for idefix for tracking down the problem! Should fix ticket #5960, but I don't personally have the hardware. The change can only affect Intuos3 tablets, though. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36791 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../input_server/devices/wacom/TabletDevice.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/add-ons/input_server/devices/wacom/TabletDevice.cpp b/src/add-ons/input_server/devices/wacom/TabletDevice.cpp index a5527d29c0..99b3584396 100644 --- a/src/add-ons/input_server/devices/wacom/TabletDevice.cpp +++ b/src/add-ons/input_server/devices/wacom/TabletDevice.cpp @@ -206,10 +206,7 @@ TabletDevice::DetectDevice(const DeviceReader* reader) SetDevice(25400.0, 20320.0, DEVICE_INTUOS3); break; case 0xB1: - // tested: - SetDevice(20320.0, 15230.0, DEVICE_INTUOS3); - // Frans: -// SetDevice(40640.0, 30480.0, DEVICE_INTUOS3); + SetDevice(40640.0, 30480.0, DEVICE_INTUOS3); break; case 0xB2: SetDevice(60960.0, 45720.0, DEVICE_INTUOS3); @@ -295,8 +292,13 @@ TabletDevice::ReadData(const uchar* data, bool& hasContact, uint32& mode, case DEVICE_INTUOS3: case DEVICE_CINTIQ: if ((data[0] == 0x02) && !(((data[1] >> 5) & 0x03) == 0x02)) { - xPos = data[2] << 8 | data[3]; - yPos = data[4] << 8 | data[5]; + if (fDeviceMode == DEVICE_INTUOS3) { + xPos = (data[2] << 9) | (data[3] << 1) | ((data[9] >> 1) & 1); + yPos = (data[4] << 9) | (data[5] << 1) | (data[9] & 1); + } else { + xPos = (data[2] << 8) | data[3]; + yPos = (data[4] << 8) | data[5]; + } uint16 pressureData = data[6] << 2 | ((data[7] >> 6) & 0x03); pressure = (float)pressureData / 1023.0;