Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Touch Events Double Registering on Windows 8

Author
Message
Lucas Tiridath
AGK Developer
15
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 7th Apr 2013 19:05 Edited at: 7th Apr 2013 19:10
Hi. I've been trying to implement a touch interface, which includes single figure dragging and two finger pinch zooming. I've been getting some strange glitches and I've found that on Windows 8, a dragged touch event seems to register twice. I wondered if anyone could give me a hand working out what's going wrong here.

I'm currently working in Tier 2 using Beta 10. Here is some code that demonstrates the problem. To see the issue, run the program on a Windows 8 PC with a multitouch screen, touch the window and drag your finger. You will see that the total touches goes to 2, even though you only have one finger on the screen. This wont happen if you keep your finger still for one second before moving, but will happen regardless of whether or not you include unknown events.

template.h


template.cpp


Anyhow any advice on how to deal with this would be greatly appreciated . Thanks.

EDIT
There are a couple of other things I should point out actually. First I've not been able to reproduce the issue in Tier 1. Second the reason that the vector collecting the touch data is in the example code is because that is the system I use in my game. If you replace agk::GetRawTouchCount(1) with touches.size(), you get the same result.

Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 9th Apr 2013 01:24
Unfortunately I don't have a Windows 8 touch device to play with, but all the touch events originate in Core.cpp in the WM_TOUCH message. If you get it to out put some debug information about what messages are being received it might reveal what's happening.
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 9th Apr 2013 07:29
This is the old bug from the intel compo.

The windows touch code whas added for the intel appup competition and this whas never solved i belive?

Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz
Lucas Tiridath
AGK Developer
15
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 9th Apr 2013 14:00 Edited at: 9th Apr 2013 14:03
Quote: "This is the old bug from the intel compo."

Sounds like it. Whilst we're on the topic, and at the risk of hijacking my own thread, is there anything I can do about my AppGameKit app crashing when something takes exclusive fullscreen like Alt-Ctrl-Del?

Thanks for the response Paul.

Quote: "Unfortunately I don't have a Windows 8 touch device to play with"

You should get Lee to use his influence with Intel to obtain one!

Quote: "all the touch events originate in Core.cpp in the WM_TOUCH message. If you get it to out put some debug information about what messages are being received it might reveal what's happening."

Right I've had a go at gathering some debug information but I'm not sure how helpful it will be so you will have to guide me if there is any more useful data I can get. So I've run some tests using the code above, but I have modified the section of the code you mentioned to include some debug information as follows:


I then ran three tests on my Windows 8 Ultrabook and directed the app to save the output to a log file. The first test involved me placing my finger on the screen and holding it there for a little over a second before releasing it. Under this test, the data on screen displayed correctly; that is to say, I had one finger on the screen and AppGameKit understood this. The log file for this test reads as follows:


In the second test, I put my finger on the screen and moved it before releasing it. This produced the double registering error. The log file is as follows:


In the final test, I placed three fingers on the screen, one after another. AppGameKit seemed to correctly identify these as well. Here is the log file for this test:


I don't know if that helps you at all with identifying the problem. I can't immediately see any issues. Clearly the log of the test that produced the glitch is not showing two touches anywhere so I don't really understand why AppGameKit thinks there are two. Anyhow let me know if there are any other tests you would like me to run and thanks for your help with this!

Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 9th Apr 2013 16:02
Thanks for the logs, the cause is the "fast touch response for mouse commands" which I don't think should be there at all, but it may have been added for some other reason I'm not aware of. Can you try removing the block


and the block above the switch statement


and see if this works for touch responses and mouse events when a mouse is plugged in?
Lucas Tiridath
AGK Developer
15
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 9th Apr 2013 18:26
Thanks for taking a look at this Paul. However I'm afraid that doesn't seem to have fixed the bug. Both the touch inputs and the mouse respond exactly as before when those sections are commented out. Just to check that I've adjusted the code correctly, here is the code from core I've just tested with the sections commented out:


Under this code, here are the logs for the test that produces the error:


Do let me know what else I can try. Thanks!

Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 9th Apr 2013 19:08
The only other explanation is if there is some other call to agk::TouchPressed somewhere in Core.cpp, there are two other instances of it but they are commented out or in #ifdefs that remove it in my copy.
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 9th Apr 2013 19:23
Have you tried using full screen. Obviously this may not be ideal but I find my app runs fine on full screen(windows 8) while I get similar issue to you when windowed.

Lucas Tiridath
AGK Developer
15
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 9th Apr 2013 19:32 Edited at: 9th Apr 2013 19:40
@Paul
In that case, I think I've found the problem. I searched through my copy of Core.cpp and found three instances of agk::TouchPressed. One is in the touch down event, where you would expect, one is ifdefed out as it is in the multi mouse code, but the third is active and appears under the left mouse down event here:


As you can see, I added the log code and sure enough, when I move my finger on the multitouch, this event is firing! This is the log for touching and moving my finger on the Ultrabook, which causes the error. I'm not touching the mouse, honest!


I don't know if you can think of any reason this would be firing, because it doesn't look like it should be to me. Anyhow I guess this may be the problem.

EDIT:
Quote: "Have you tried using full screen. Obviously this may not be ideal but I find my app runs fine on full screen(windows 8) while I get similar issue to you when windowed."

Sorry Matty H, I missed your post while I was writing this. I've just run a quick test of fullscreen on the Ultrabook and the error persists. In fact, my WIP which I first noticed this problem in runs fullscreen. Could it be a fault with my Ultrabook? It is one of the prototype Intel ones from the compo after all...

Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 9th Apr 2013 23:06
The Core.cpp from the latest 108 beta 10 should have those touch commands in the mouse messages commented out. Although Windows generating mouse messages for touch events could cause other problems for AppGameKit, having a look at some documentation states that they can be filtered out using
Lucas Tiridath
AGK Developer
15
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 10th Apr 2013 00:40
Quote: "The Core.cpp from the latest 108 beta 10 should have those touch commands in the mouse messages commented out."

Ah... I'll be honest, I didn't realise there was a new template for beta 10... Must have missed that.

Anyhow I've inserted your code into my Core.cpp file and it seems to be working well now. Thanks for your help!

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 10th Apr 2013 16:58
The templates are in the AGK\IDE\apps directory and the VS2010 one does work.

I don't know if it has the touch issues on Windows 8 (not having a Windows 8 machine to test on).

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Lucas Tiridath
AGK Developer
15
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 10th Apr 2013 19:17
Quote: "The templates are in the AGK\IDE\apps directory and the VS2010 one does work."

Ah thanks AL, found it now. I'm easily confused..

Quote: "I don't know if it has the touch issues on Windows 8"

I've just tested the above Tier 2 code built with the unmodified beta 10 template and it's working fine. Thanks for your help!

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 10th Apr 2013 20:22
Always happy to help, especially when it is this easy.

Happy Programming!

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master

Login to post a reply

Server time is: 2024-05-04 15:27:42
Your offset time is: 2024-05-04 15:27:42