18 January 2024, 00:17 | #1 |
Registered User
Join Date: Dec 2017
Location: Austin, TX
Age: 41
Posts: 412
|
Pointer warps on click with tablet emulation
WinUAE 5.1.0, Wacom Intuos tablet, tablet emulation enabled, mousehack enabled. OS 3.2 with RTG and 3.1 with native.
This configuration almost works perfectly. When I depress the left or right "mouse" buttons, however, the pointer warps to a location several hundred pixels to the right and down and then immediately warps back. The same happens when releasing the button. I figured some bad input events were being fed through mousehack and captured a log with -tabletlog 7, below. But it looks OK at a glance. The anomalous warps occur somewhere around the 'tablet: B=00000002/0 p=1' lines. Happy to do some digging through the code but would appreciate any pointers on where to look. Code:
tablet: X=863 y=428 z=1023 ax=85 ay=175 az=0 tablet: B=00000000 f=00000000 x=13800 y=21083 p=0 (1200,620,0) tablet: B=00000000 f=00000000 x=13801 y=21083 p=0 (1180,620,0) tablet: X=863 y=428 z=1023 ax=83 ay=175 az=0 tablet: B=00000002 f=00000000 x=13801 y=21083 p=0 (1180,620,0) tablet: B=00000002 p=1 tablet: X=863 y=428 z=1023 ax=83 ay=175 az=0 tablet: B=00000002 f=00000000 x=13801 y=21077 p=0 (1180,620,0) tablet: X=863 y=429 z=1023 ax=83 ay=175 az=0 tablet: B=00000002 f=00000000 x=13801 y=21073 p=0 (1180,620,0) tablet: B=00000002 f=00000000 x=13801 y=21066 p=0 (1180,620,0) tablet: B=00000002 f=00000000 x=13801 y=21059 p=0 (1180,620,0) tablet: X=863 y=430 z=1023 ax=83 ay=175 az=0 tablet: B=00000002 f=00000000 x=13801 y=21052 p=0 (1180,620,0) tablet: B=00000002 f=00000000 x=13801 y=21045 p=0 (1180,620,0) tablet: X=863 y=431 z=1023 ax=83 ay=175 az=0 tablet: B=00000002 f=00000000 x=13801 y=21038 p=0 (1180,620,0) tablet: B=00000002 f=00000000 x=13801 y=21030 p=0 (1180,620,0) tablet: X=863 y=432 z=1023 ax=83 ay=175 az=0 tablet: B=00000002 f=00000000 x=13801 y=21024 p=0 (1180,620,0) tablet: B=00000002 f=00000000 x=13801 y=21019 p=0 (1180,620,0) tablet: B=00000002 f=00000000 x=13801 y=21015 p=0 (1190,630,0) tablet: X=863 y=433 z=1023 ax=84 ay=178 az=0 tablet: B=00000002 f=00000000 x=13801 y=21011 p=0 (1190,630,0) tablet: B=00000002 f=00000000 x=13801 y=21007 p=0 (1190,630,0) tablet: B=00000002 f=00000000 x=13801 y=21005 p=0 (1170,630,0) tablet: X=863 y=433 z=1023 ax=82 ay=178 az=0 tablet: B=00000002 f=00000000 x=13799 y=21004 p=0 (1170,630,0) tablet: X=862 y=433 z=1023 ax=82 ay=178 az=0 tablet: B=00000002 f=00000000 x=13796 y=21003 p=0 (1170,630,0) tablet: B=00000002 f=00000000 x=13794 y=21003 p=0 (1160,630,0) tablet: B=00000002 f=00000000 x=13792 y=21003 p=0 (1160,630,0) tablet: B=00000002 f=00000000 x=13791 y=21003 p=0 (1160,630,0) tablet: B=00000002 f=00000000 x=13790 y=21003 p=0 (1160,630,0) tablet: B=00000002 f=00000000 x=13789 y=21003 p=0 (1180,620,0) tablet: X=862 y=433 z=1023 ax=83 ay=175 az=0 tablet: B=00000002 f=00000000 x=13789 y=21013 p=0 (1180,620,0) tablet: B=00000000 f=00000000 x=13789 y=21013 p=0 (1180,620,0) tablet: B=00000000 p=1 tablet: X=862 y=433 z=1023 ax=83 ay=175 az=0 tablet: B=00000000 f=00000000 x=13789 y=21032 p=0 (1180,620,0) tablet: X=862 y=431 z=1023 ax=83 ay=175 az=0 |
20 January 2024, 13:57 | #2 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,573
|
Add also following command line parameters: "-inputlog 2 -inputdevicelog -1"
(-inpulog 2 = log host mouse events) Does it show anything interesting when it jumps? |
21 January 2024, 04:17 | #3 |
Registered User
Join Date: Dec 2017
Location: Austin, TX
Age: 41
Posts: 412
|
There are no other input events at the time.
I've managed to track this down some way. I wrote an input handler to dump the events Intuition sees and this is happening:
Edit: Here it is! Now the pen works perfectly. filesys.asm is adding IntuitionBase->MouseX/Y to these values. (A remaining problem is the mouse moves haphazardly in tablet emulation mode and the buttons don't work. I'm not sure if that's expected, so I might poke around that as well.) Code:
diff --git a/inputdevice.cpp b/inputdevice.cpp index f8cde0e5..945626bb 100644 --- a/inputdevice.cpp +++ b/inputdevice.cpp @@ -2917,6 +2917,11 @@ void inputdevice_tablet (int x, int y, int z, int pressure, uae_u32 buttonbits, p[MH_BUTTONBITS + 2] = buttonbits >> 8; p[MH_BUTTONBITS + 3] = buttonbits >> 0; + p[MH_ABSX] = 0; + p[MH_ABSX + 1] = 0; + p[MH_ABSY] = 0; + p[MH_ABSY + 1] = 0; + if (inproximity < 0) { p[MH_INPROXIMITY] = p[MH_INPROXIMITY + 1] = 0xff; } else { Last edited by arcanist; 21 January 2024 at 05:46. |
21 January 2024, 19:38 | #4 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,573
|
I am not sure how that can fix it, now ie_xy coordinates would be always 0,0. (It is actually ibase->View.DxOffset/DyOffset that is subtracted from coordinates, not MouseX/MouseY)
It should work correctly if ibase->MouseX/MouseY is copied to ie_xy when in tablet mode. Does https://www.winuae.net/files/b/winuae.7z work? (which has above change) |
21 January 2024, 20:00 | #5 | |
Registered User
Join Date: Dec 2017
Location: Austin, TX
Age: 41
Posts: 412
|
Quote:
With my change the RAWMOUSE ie_xy fields are always zero. This works. With your change the pointer warps to a position exactly 2*pen_xy. i.e. Intuition is interpreting these as relative movements. Using the mouse instead I see both RAWMOUSE events and POINTERPOS events, the latter doing the correct movement. The RAWMOUSE ie_xy is non-zero and causes the same warping effect. I'm not actually sure where the RAWMOUSE behavior is documented. |
|
21 January 2024, 20:13 | #6 | |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,573
|
Quote:
Ah, it always also sends IECLASS_POINTERPOS even when in tablet mode (IECLASS_NEWPOINTERPOS). This event probably is handled as relative (ie_Qualifier is queried). winuae.7z updated, IECLASS_POINTERPOS skipped if tablet mode (note that you might get old winuae.7z, if it happens, append ?<something randon> at the end of url to bypass cached data. Mouse driver and tablet mode should be handled separately... This also explains why they don't want to work very well when both modes are enabled at the same time. |
|
21 January 2024, 20:35 | #7 | |
Registered User
Join Date: Dec 2017
Location: Austin, TX
Age: 41
Posts: 412
|
Quote:
Here's a log of the events received when the pen button is pressed and the pointer jumps: Code:
IESUBCLASS_NEWTABLET: SX=0 SY=0 SXF=0 SYF=0 TX=999 TY=404 RX=2793 RY=1746 QUAL=0x0 IESUBCLASS_NEWTABLET: SX=0 SY=0 SXF=0 SYF=0 TX=999 TY=404 RX=2793 RY=1746 QUAL=0x0 IESUBCLASS_NEWTABLET: SX=0 SY=0 SXF=0 SYF=0 TX=999 TY=404 RX=2793 RY=1746 QUAL=0x0 IESUBCLASS_NEWTABLET: SX=0 SY=0 SXF=0 SYF=0 TX=999 TY=404 RX=2793 RY=1746 QUAL=0x0 IECLASS_RAWMOUSE: X=457 Y=166 CODE=0x68 QUAL=0x4000 IESUBCLASS_NEWTABLET: SX=0 SY=0 SXF=0 SYF=0 TX=999 TY=404 RX=2793 RY=1746 QUAL=0x4000 IESUBCLASS_NEWTABLET: SX=0 SY=0 SXF=0 SYF=0 TX=999 TY=404 RX=2793 RY=1746 QUAL=0x4000 IESUBCLASS_NEWTABLET: SX=0 SY=0 SXF=0 SYF=0 TX=999 TY=404 RX=2793 RY=1746 QUAL=0x4000 IESUBCLASS_NEWTABLET: SX=0 SY=0 SXF=0 SYF=0 TX=999 TY=404 RX=2793 RY=1746 QUAL=0x4000 Code:
IECLASS_RAWMOUSE: X=122 Y=120 CODE=0xff QUAL=0x8000 IECLASS_RAWMOUSE: X=120 Y=120 CODE=0xff QUAL=0x8000 IECLASS_RAWMOUSE: X=240 Y=240 CODE=0xff QUAL=0x8000 IECLASS_POINTERPOS: X=445 Y=250 CODE=0x0 QUAL=0x0 IECLASS_POINTERPOS: X=446 Y=252 CODE=0x0 QUAL=0x0 IECLASS_RAWMOUSE: X=120 Y=120 CODE=0xff QUAL=0x8000 IECLASS_POINTERPOS: X=447 Y=252 CODE=0x0 QUAL=0x0 IECLASS_RAWMOUSE: X=120 Y=120 CODE=0xff QUAL=0x8000 IECLASS_RAWMOUSE: X=120 Y=120 CODE=0xff QUAL=0x8000 IECLASS_POINTERPOS: X=448 Y=252 CODE=0x0 QUAL=0x0 IECLASS_RAWMOUSE: X=120 Y=120 CODE=0xff QUAL=0x8000 Edit: I wrote a program to inject RAWMOUSE events. It does appear Intuition ignores the relative qualifier bit and always treats these events as relative. Perhaps one option is to set IEQUALIFIER_RELATIVEMOUSE and set ie_xy to 0. Then other input handlers can interpret the event correctly. Last edited by arcanist; 21 January 2024 at 21:32. |
|
22 January 2024, 20:01 | #8 | ||
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,573
|
Quote:
Quote:
(Did you test using OS3.1 or 3.2+?) |
||
22 January 2024, 21:00 | #9 | |
Registered User
Join Date: Dec 2017
Location: Austin, TX
Age: 41
Posts: 412
|
Quote:
I tested this build on 3.1 and 3.2. I also tested RAWMOUSE event injection on 3.1 and 3.2 and both handle these as Mouse_XY += 100. I guess they were meant to originate from a mouse device and were assumed to always be relative. Code:
IECLASS_RAWMOUSE: X=100 Y=100 CODE=0xff QUAL=0x8000 IECLASS_RAWMOUSE: X=100 Y=100 CODE=0xff QUAL=0x0 |
|
22 January 2024, 21:18 | #10 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,573
|
IEQUALIFIER_RELATIVEMOUSE is now set (was set previously but it was overwritten). I also set it in IECLASS_NEWPOINTERPOS event which may or may not be a good idea. Please confirm
|
22 January 2024, 22:19 | #11 | |
Registered User
Join Date: Dec 2017
Location: Austin, TX
Age: 41
Posts: 412
|
Quote:
Code:
IESUBCLASS_NEWTABLET: SX=16384 SY=2204 SXF=16398 SYF=14014 TX=16255862 TY=16255802 RX=16255804 RY=16255806 QUAL=0xc000 IESUBCLASS_NEWTABLET: SX=16384 SY=2204 SXF=16398 SYF=14014 TX=16255862 TY=16255802 RX=16255804 RY=16255806 QUAL=0xc000 IESUBCLASS_NEWTABLET: SX=16384 SY=2204 SXF=16398 SYF=14014 TX=16255862 TY=16255802 RX=16255804 RY=16255806 QUAL=0xc000 IECLASS_RAWMOUSE: X=0 Y=0 CODE=0xe8 QUAL=0x8000 IESUBCLASS_NEWTABLET: SX=16384 SY=2204 SXF=16398 SYF=14014 TX=16255862 TY=16255802 RX=16255804 RY=16255806 QUAL=0x8000 |
|
23 January 2024, 17:17 | #12 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,573
|
Oops, InputEvent has union fields (ie_xy, ie_addr and ie_dead). Better not clear mouse position fields when ie_addr is in use
|
23 January 2024, 18:20 | #13 |
Registered User
Join Date: Dec 2017
Location: Austin, TX
Age: 41
Posts: 412
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Graphics Tablet under emulation | Marle | support.WinUAE | 5 | 25 August 2018 11:27 |
Amiga Emulation on Nvidia Shield or Windows Bay Trail Tablet | pinchez | New to Emulation or Amiga scene | 2 | 12 March 2016 23:59 |
Summagraphics tablet emulation | mark_k | request.UAE Wishlist | 0 | 13 February 2016 21:57 |
50hz emulation on Windows 8.1 tablet | endre1952 | support.WinUAE | 12 | 07 August 2015 21:35 |
Right click on WinUAE tray icon pauses emulation | smoorke | support.WinUAE | 1 | 20 September 2008 16:25 |
|
|