- Home /
Windows 7 Touch and Unity3d Fullscreen problem
Hello,
I have a question about handling Windows messages.
In particular I need to handle WM_TOUCH messages on Windows 7 from within Unity (see note on TUIO later).
In a Windows forms application, for instance, I would override WndProc and handle the message there.
In a Win32 (e.g. directx) application, I would implement a Message handler and use PeekMessage to get each message - farming off WM_TOUCH to a specific method to handle the decoding.
However (I believe) neither option is available to me in Unity3d since this stuff is, rightly, hidden away from developers.
So what I have done so far to try to get this working is to implement a message snooper method in an external DLL, which gets called regularly (e.g. in Update()). This peeks windows messages from the Hwnd of the Unity game window.
I can successfully trap WM_TOUCH messages in this way, and am farming them off to my decode method. Now here's the problem - the LPARAM is an invalid handle for these messages. I believe this is because the Unity message loop has already processed them with DispatchMessage. (see link text).
Therefore this approach has come to a dead end.
What I really want to be able to do is write some code in the Unity message loops to handle my WM_TOUCH messages.
Does anyone have any suggestions on how I can get this to work, or if there'll be anything in Unity 3 that will help me?
NB: I would maybe like to use TUIO, but I'm yet to find a TUIO source for Windows7 multitouch that will work in full screen mode with no user configuration. I've tried W2TUIO but am not having much luck with it.
Any information/help will be gratefully received.
Thanks, Andrew
Answer by Peter 7 · Sep 28, 2010 at 07:15 AM
Thanks for the link I have watched the video, however note my NB: I would maybe like to use TUIO, but I'm yet to find a TUIO source for Windows7 mul$$anonymous$$ch that will work in full screen mode with no user configuration. I've tried W2TUIO but am not having much luck with it.
Basically can anyone suggest a Windows 7 mul$$anonymous$$ch TUIO source? If not then I cannot use the approach outlined in the linked video.
Thanks, Andrew
Answer by Virtualware · Sep 27, 2012 at 07:21 AM
If you are still interested in multitouch in Windows 7, we have released a native solution, which does not requires TUIO or any other external program. http://forum.unity3d.com/threads/152685-RELEASED-Windows-7-multitouch
Answer by Wolfram · May 24, 2011 at 11:45 PM
For reference, I'll answer to this rather old question:
There has been a new touch bridge for Windows7->TUIO touches out there since end of last year, Touch2Tuio. It works flawlessly, without any overlay windows, and especially if the Unity app is running in fullscreen mode).
We're using uniTUIO and have had very good results with this bridge. All you need is a little wrapper script that automatically starts Touch2Tuio after your application launches.
Hi Wolfram $$anonymous$$resse, could you share your wrapper script ? here is $$anonymous$$e :) http://pastebin.com/Jzerf2Hi
We're using Windows system calls: http://pastebin.com/NGtU$$anonymous$$pYy Note you'll need to replace the Arguments string with your project name. Also, Touch2Tuio comes in 32bit and 64 bit versions, so make sure you use the one matching your build.
Answer by SpielwerkZ · Oct 17, 2011 at 03:09 PM
Reading the various threads on the subject of multi-touch and Windows7, what are the chances of Unity3 natively supporting Windows7 multi-touch messages?
The structure is already there for the sake of smart phone applications with the Input.touches array, etc... why can't Windows7 natively do this going forward rather than having to use a kludge like TUIO?
Your answer
Follow this Question
Related Questions
Need help for my plugin to unity And multi-touch on PC!! 2 Answers
Windows 10 multitouch test in editor 0 Answers
Windows 7 Multitouch limits 0 Answers
multitouch on desktop possible 1 Answer
Does unity now support multitouch directly in windows? 1 Answer