usb-hid: Fix 0/0 position for Windows in tablet mode
PATCH 1/1 usb-hid: Fix 0/0 position for Windows in tablet mode
For unknown reasons, Windows drivers (tested with XP and Win7) ignore usb-tablet events that move the pointer to 0/0. So always set bit 0 of the coordinates.
--- hw/usb-hid.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
hw/usb-hid.c +4 -2
@@ -457,8 +457,10 @@ static void usb_pointer_event_combine(USBPointerEvent *e, int xyrel, e->xdx += x1; e->ydy += y1; }else { - e->xdx = x1; - e->ydy = y1; +/* Windows drivers do not like the 0/0 position and ignore such +* events. */ + e->xdx = x1 |1 ; + e->ydy = y1 |1 ; } e->dz += z1; }
Am 24.06.2011 um 16:27 schrieb Jan Kiszka:
Quoted 22 lines
For unknown reasons, Windows drivers (tested with XP and Win7) ignore usb-tablet events that move the pointer to 0/0. So always set bit 0 of the coordinates.
Signed-off-by Jan Kiszka <[email protected]>---
hw/usb-hid.c| 6 ++++--1 files changed, 4 insertions(+), 2 deletions(-)hw/usb-hid.c +1
-2@@ -457,8 +457,10 @@ static void usb_pointer_event_combine(USBPointerEvent *e, int xyrel, e->xdx += x1; e->ydy += y1; }else { - e->xdx = x1; - e->ydy = y1; +/* Windows drivers do not like the 0/0 position and ignore such
hw/usb-hid.c static void usb_pointer_event_combine(USBPointerEvent *e, int xyrel, · line 463
Quoted 3 lines
hw/usb-hid.c +3
-0+* events. */ + e->xdx = x1 |1 ; + e->ydy = y1 |1 ;
Doesn't this change mean we can't access any other even pixel either?
Andreas
Quoted 3 lines
}
e->dz += z1;
}Quoted 20 lines · Andreas Färber
Am 24.06.2011 um 16:27 schrieb Jan Kiszka:
Quoted 18 lines
For unknown reasons, Windows drivers (tested with XP and Win7) ignore usb-tablet events that move the pointer to 0/0. So always set bit 0 of the coordinates.
Signed-off-by Jan Kiszka <[email protected]>---
hw/usb-hid.c| 6 ++++--1 files changed, 4 insertions(+), 2 deletions(-)hw/usb-hid.c +0
-0@@ -457,8 +457,10 @@ static void usb_pointer_event_combine(USBPointerEvent *e, int xyrel, e->xdx += x1; e->ydy += y1; }else {
Quoted 8 lines
hw/usb-hid.c static void usb_pointer_event_combine(USBPointerEvent *e, int xyrel, · line 463
Quoted 6 lines
hw/usb-hid.c +4
-2- e->xdx = x1; - e->ydy = y1; +/* Windows drivers do not like the 0/0 position and ignore such +* events. */ + e->xdx = x1 |1 ; + e->ydy = y1 |1 ;Doesn't this change mean we can't access any other even pixel either?
Only on 32767x32767 screens (that's the resolution of the tablet).
Jan
Am 25.06.2011 um 14:55 schrieb Jan Kiszka:
Quoted 31 lines · Andreas Färber
Quoted 21 lines
Am 24.06.2011 um 16:27 schrieb Jan Kiszka:
Quoted 19 lines
For unknown reasons, Windows drivers (tested with XP and Win7) ignore usb-tablet events that move the pointer to 0/0. So always set bit 0 of the coordinates.
Signed-off-by Jan Kiszka <[email protected]>---
hw/usb-hid.c| 6 ++++--1 files changed, 4 insertions(+), 2 deletions(-)hw/usb-hid.c +0
-1@@ -457,8 +457,10 @@ static void usb_pointer_event_combine(USBPointerEvent *e, int xyrel, e->xdx += x1; e->ydy += y1; }else { - e->xdx = x1;Quoted 8 lines
hw/usb-hid.c static void usb_pointer_event_combine(USBPointerEvent *e, int xyrel, · line 463
Quoted 6 lines
hw/usb-hid.c +1
-1- e->ydy = y1; +/* Windows drivers do not like the 0/0 position and ignore such
hw/usb-hid.c +3
-0+* events. */ + e->xdx = x1 |1 ; + e->ydy = y1 |1 ;Doesn't this change mean we can't access any other even pixel either?
Quoted 1 line
Only on 32767x32767 screens (that's the resolution of the tablet).
Well, if it's just a fix for 0/0 I would've expected something like:
e->xdx = x1 ? x1 : 1;e->ydy = y1 ? y1 : 1;
Andreas
Quoted 33 lines · Andreas Färber
Am 25.06.2011 um 14:55 schrieb Jan Kiszka:
Quoted 31 lines · Andreas Färber
Quoted 29 lines
Am 24.06.2011 um 16:27 schrieb Jan Kiszka:
Quoted 22 lines
For unknown reasons, Windows drivers (tested with XP and Win7) ignore usb-tablet events that move the pointer to 0/0. So always set bit 0 of the coordinates.
Signed-off-by Jan Kiszka <[email protected]>---
hw/usb-hid.c| 6 ++++--1 files changed, 4 insertions(+), 2 deletions(-)hw/usb-hid.c +1
-2@@ -457,8 +457,10 @@ static void usb_pointer_event_combine(USBPointerEvent *e, int xyrel, e->xdx += x1; e->ydy += y1; }else { - e->xdx = x1; - e->ydy = y1; +/* Windows drivers do not like the 0/0 position and ignore such
hw/usb-hid.c static void usb_pointer_event_combine(USBPointerEvent *e, int xyrel, · line 463
Quoted 3 lines
hw/usb-hid.c +3
-0+* events. */ + e->xdx = x1 |1 ; + e->ydy = y1 |1 ;Doesn't this change mean we can't access any other even pixel either?
Quoted 6 lines
Quoted 1 line
Only on 32767x32767 screens (that's the resolution of the tablet).
Well, if it's just a fix for 0/0 I would've expected something like:
e->xdx= x1 ? x1 : 1;e->ydy= y1 ? y1 : 1;
Works as well, my version is a little bit simpler. But I don't mind, will post whatever is preferred to fix this.
Jan
Quoted 36 lines · Jan Kiszka
Quoted 35 lines · Andreas Färber
Am 25.06.2011 um 14:55 schrieb Jan Kiszka:
Quoted 32 lines · Andreas Färber
Quoted 21 lines
Am 24.06.2011 um 16:27 schrieb Jan Kiszka:
Quoted 19 lines
For unknown reasons, Windows drivers (tested with XP and Win7) ignore usb-tablet events that move the pointer to 0/0. So always set bit 0 of the coordinates.
Signed-off-by Jan Kiszka <[email protected]>---
hw/usb-hid.c| 6 ++++--1 files changed, 4 insertions(+), 2 deletions(-)hw/usb-hid.c +0
-1@@ -457,8 +457,10 @@ static void usb_pointer_event_combine(USBPointerEvent *e, int xyrel, e->xdx += x1; e->ydy += y1; } else { - e->xdx = x1;Quoted 8 lines
Quoted 6 lines
hw/usb-hid.c +1
-1- e->ydy = y1; + /* Windows drivers do not like the 0/0 position and ignoresuch
+ * events. */
+ e->xdx = x1 | 1;
+ e->ydy = y1 | 1;Doesn't this change mean we can't access any other even pixel either?
Only on 32767x32767 screens (that's the resolution of the tablet).
Quoted 7 lines
Quoted 4 lines
Well, if it's just a fix for 0/0 I would've expected something like:
e->xdx= x1 ? x1 : 1;e->ydy= y1 ? y1 : 1;Works as well, my version is a little bit simpler. But I don't mind, will post whatever is preferred to fix this.
Would it be enough to just do this for x or y, not both?
Cheers
PATCH v2 1/1 usb-hid: Fix 0/0 position for Windows in tablet mode
Quoted 39 lines · andrzej zaborowski
Quoted 38 lines · Jan Kiszka
Quoted 37 lines · Andreas Färber
Am 25.06.2011 um 14:55 schrieb Jan Kiszka:
Quoted 31 lines · Andreas Färber
Quoted 21 lines
Am 24.06.2011 um 16:27 schrieb Jan Kiszka:
Quoted 19 lines
For unknown reasons, Windows drivers (tested with XP and Win7) ignore usb-tablet events that move the pointer to 0/0. So always set bit 0 of the coordinates.
Signed-off-by Jan Kiszka <[email protected]>---
hw/usb-hid.c| 6 ++++--1 files changed, 4 insertions(+), 2 deletions(-)hw/usb-hid.c +0
-1@@ -457,8 +457,10 @@ static void usb_pointer_event_combine(USBPointerEvent *e, int xyrel, e->xdx += x1; e->ydy += y1; }else { - e->xdx = x1;Quoted 8 lines
hw/usb-hid.c
Quoted 6 lines
hw/usb-hid.c +1
-1- e->ydy = y1; +/* Windows drivers do not like the 0/0 position and ignore such
hw/usb-hid.c +3
-0+* events. */ + e->xdx = x1 |1 ; + e->ydy = y1 |1 ;Doesn't this change mean we can't access any other even pixel either?
Quoted 1 line
Only on 32767x32767 screens (that's the resolution of the tablet).
Well, if it's just a fix for 0/0 I would've expected something like:
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
e->xdx= x1 ? x1 : 1;e->ydy= y1 ? y1 : 1;Works as well, my version is a little bit simpler. But I don't mind, will post whatever is preferred to fix this.
Would it be enough to just do this for x or y, not both?
Yes, looks like. Is this one better?
Jan
----------8<---------
From: Jan Kiszka <[email protected]>
For unknown reasons, Windows drivers (tested with XP and Win7) ignore usb-tablet events that move the pointer to 0/0. So always report 0/0 as 1/0.
--- hw/usb-hid.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
hw/usb-hid.c +5 -0
@@ -459,6 +459,11 @@ static void usb_pointer_event_combine(USBPointerEvent *e, int xyrel, }else { e->xdx = x1; e->ydy = y1; +/* Windows drivers do not like the 0/0 position and ignore such +* events. */ +if (!(x1 | y1)) { + x1 =1 ; + } } e->dz += z1; }
Signature · 1 line
1.7.3.4
Am 12.07.2011 um 09:47 schrieb Jan Kiszka:
Quoted 44 lines · andrzej zaborowski
Quoted 43 lines · Jan Kiszka
Quoted 42 lines · Andreas Färber
Quoted 40 lines
Am 25.06.2011 um 14:55 schrieb Jan Kiszka:
Quoted 32 lines · Andreas Färber
Quoted 22 lines
Am 24.06.2011 um 16:27 schrieb Jan Kiszka:
Quoted 20 lines
For unknown reasons, Windows drivers (tested with XP and Win7) ignore usb-tablet events that move the pointer to 0/0. So always set bit 0 of the coordinates.
Signed-off-by Jan Kiszka <[email protected]>---
hw/usb-hid.c| 6 ++++--1 files changed, 4 insertions(+), 2 deletions(-)hw/usb-hid.c +0
-2@@ -457,8 +457,10 @@ static void usb_pointer_event_combine(USBPointerEvent *e, int xyrel, e->xdx += x1; e->ydy += y1; }else { - e->xdx = x1; - e->ydy = y1;Quoted 8 lines
hw/usb-hid.c
Quoted 6 lines
hw/usb-hid.c +1
-0+/* Windows drivers do not like the 0/0 position and ignore
suchhw/usb-hid.c +3
-0+* events. */ + e->xdx = x1 |1 ; + e->ydy = y1 |1 ;Doesn't this change mean we can't access any other even pixel either?
Quoted 1 line
Only on 32767x32767 screens (that's the resolution of the tablet).
Well, if it's just a fix for 0/0 I would've expected something like:
e->xdx= x1 ? x1 : 1;e->ydy= y1 ? y1 : 1;
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
Works as well, my version is a little bit simpler. But I don't mind, will post whatever is preferred to fix this.
Would it be enough to just do this for x or y, not both?
Yes, looks like. Is this one better?
To me it looks better, yes.
Thanks,
Andreas
Quoted 33 lines
----------8<---------
From: Jan Kiszka <[email protected]>
For unknown reasons, Windows drivers (tested with XP and Win7) ignore usb-tablet events that move the pointer to 0/0. So always report 0/0 as 1/0.
Signed-off-by Jan Kiszka <[email protected]>---
hw/usb-hid.c| 5 +++++1 files changed, 5 insertions(+), 0 deletions(-)hw/usb-hid.c +1
-0@@ -459,6 +459,11 @@ static void usb_pointer_event_combine(USBPointerEvent *e, int xyrel, } else { e->xdx = x1; e->ydy = y1; + /* Windows drivers do not like the 0/0 position and ignoresuch
hw/usb-hid.c +4
-0+* events. */ +if (!(x1 | y1)) { + x1 =1 ; + } } e->dz += z1;}
Signature · 1 line
1.7.3.4
Quoted 57 lines · Andreas Färber
Am 12.07.2011 um 09:47 schrieb Jan Kiszka:
Quoted 55 lines · andrzej zaborowski
Quoted 45 lines · Jan Kiszka
Quoted 43 lines · Andreas Färber
Quoted 41 lines
Am 25.06.2011 um 14:55 schrieb Jan Kiszka:
Quoted 34 lines · Andreas Färber
Quoted 24 lines
Am 24.06.2011 um 16:27 schrieb Jan Kiszka:
Quoted 21 lines
For unknown reasons, Windows drivers (tested with XP and Win7) ignore
usb-tablet events that move the pointer to 0/0. So always set bit 0 of
the coordinates.Signed-off-by Jan Kiszka <[email protected]>---
hw/usb-hid.c| 6 ++++--1 files changed, 4 insertions(+), 2 deletions(-)hw/usb-hid.c +0
-1@@ -457,8 +457,10 @@ static void usb_pointer_event_combine(USBPointerEvent *e, int xyrel, e->xdx += x1; e->ydy += y1; } else { - e->xdx = x1;Quoted 8 lines
Quoted 6 lines
hw/usb-hid.c +1
-1- e->ydy = y1; + /* Windows drivers do not like the 0/0 position and ignoresuch
+ * events. */
+ e->xdx = x1 | 1;
+ e->ydy = y1 | 1;Doesn't this change mean we can't access any other even pixel either?
Quoted 1 line
Only on 32767x32767 screens (that's the resolution of the tablet).
Well, if it's just a fix for 0/0 I would've expected something like:
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
e->xdx= x1 ? x1 : 1;e->ydy= y1 ? y1 : 1;Works as well, my version is a little bit simpler. But I don't mind, will post whatever is preferred to fix this.
Would it be enough to just do this for x or y, not both?
Yes, looks like. Is this one better?
I pushed this version, thanks.
Cheers