Gamestudio Links
Zorro Links
Newest Posts
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
LPDIRECT3DCUBETEXTUR
E9

by Ayumi. 04/12/24 11:00
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 04/11/24 14:56
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Quad, AndrewAMD), 410 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
11honza11, ccorrea, sakolin, rajesh7827, juergen_wue
19045 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
{FIXED} Capturing correct tap position on Windows tablet #454269
09/02/15 20:26
09/02/15 20:26
Joined: Aug 2015
Posts: 10
Michigan
41Lumber Offline OP
Newbie
41Lumber  Offline OP
Newbie

Joined: Aug 2015
Posts: 10
Michigan
It seems like this would be extremely easy, but not so much. If I tap the touch screen on my tablet, it doesn't immediately move mouse_pos. Even if I wait a frame or two, mouse_pos remains at the last tap position, which makes pressing buttons quite unintuitive.

Is there anything I can do, in lite-C or a plugin API, that will get the exact screen position of the most recent touch? I've attempted to process WM_GESTURE but had little success.

Last edited by 41Lumber; 09/03/15 17:16.
Re: Capturing correct tap position on Windows tablet [Re: 41Lumber] #454270
09/02/15 20:33
09/02/15 20:33
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
GetCursorPos
MSDN: https://msdn.microsoft.com/de-de/library/windows/desktop/ms648390(v=vs.85).aspx

Make sure to only call it once if possible to reduce a waste of function calls

Last edited by Ch40zzC0d3r; 09/02/15 20:33.
Re: Capturing correct tap position on Windows tablet [Re: Ch40zzC0d3r] #454274
09/03/15 06:10
09/03/15 06:10

M
Malice
Unregistered
Malice
Unregistered
M



Hey @Ch40zzC0d3r, thanks for being the one to dig into msdn for us these days. It's off subject, but thanks we have so few that can do it these days.

Re: Capturing correct tap position on Windows tablet [Re: ] #454291
09/03/15 11:54
09/03/15 11:54
Joined: Aug 2015
Posts: 10
Michigan
41Lumber Offline OP
Newbie
41Lumber  Offline OP
Newbie

Joined: Aug 2015
Posts: 10
Michigan
Nope, same problem, although you did solve another question I've had for some time. Touch screen apparently doesn't set the cursor position right away, so I'm still not sure what to do.

Re: Capturing correct tap position on Windows tablet [Re: 41Lumber] #454296
09/03/15 13:57
09/03/15 13:57
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
I guess your srceen is not calibrated right then

Re: Capturing correct tap position on Windows tablet [Re: Ch40zzC0d3r] #454297
09/03/15 14:25
09/03/15 14:25
Joined: Aug 2015
Posts: 10
Michigan
41Lumber Offline OP
Newbie
41Lumber  Offline OP
Newbie

Joined: Aug 2015
Posts: 10
Michigan
Re-calibrated, same results. No other programs display this problem, so I know it's an issue with how I am receiving the touch events.

Re: Capturing correct tap position on Windows tablet [Re: 41Lumber] #454298
09/03/15 15:14
09/03/15 15:14
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
GetCursorPos retrieves the cursor pos directly from the kernel through some syscalls. You can register a windows hook and check WM_MOUSE.
If that value should be off then your doing something wrong because thats the exact way how normal programs get the cursor positions for the gui.

Re: Capturing correct tap position on Windows tablet [Re: Ch40zzC0d3r] #454301
09/03/15 17:16
09/03/15 17:16
Joined: Aug 2015
Posts: 10
Michigan
41Lumber Offline OP
Newbie
41Lumber  Offline OP
Newbie

Joined: Aug 2015
Posts: 10
Michigan
End result: Fixed.

Without a mouse interface, Windows apparently does not treat cursor position the same way. In order to properly receive touch events, I had to watch for window message WM_POINTERUPDATE (decimal 581), and retrieve the correct position from the lParam value.

Re: Capturing correct tap position on Windows tablet [Re: 41Lumber] #454303
09/03/15 17:50
09/03/15 17:50

M
Malice
Unregistered
Malice
Unregistered
M



41Lumber is it all right to ask you to share a basic example in the lite-
c contributions section. This way if the question arises in the future from another users, a forum search will yield a thread with a working base example.

Re: Capturing correct tap position on Windows tablet [Re: ] #454304
09/03/15 18:34
09/03/15 18:34
Joined: Aug 2015
Posts: 10
Michigan
41Lumber Offline OP
Newbie
41Lumber  Offline OP
Newbie

Joined: Aug 2015
Posts: 10
Michigan
Certainly, I will share that.


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1