- Home /
Windows Touch in the Editor
I'm attempting to use a Windows touch plugin provided by this fine gentleman.
The plugin gets multi-touch information from a window name that you pass to it. It works great when I compile the app, but I'm having trouble getting it to work in the editor.
I'm passing the name of the Editor window name amalgamation that shows at the top of the window of the Editor. An example would be Main.unity - SceneName - PC, Mac & Linux Standalone. Passing the plugin this window name doesn't return any touch data. My question is, does anyone know if the Unity Editor has any other windows associated with receiving input? It's the only thing I can think would be getting in the way of getting input to the plugin.
Plugin Links:
http://software.intel.com/en-us/blogs/2013/05/01/the-unity-multi-touch-source-finally?page=1
Hi. Did you ever get this working? His original .exe works, but I'm not having any success on building my own with his dll. I get 128 touches. I also rebuilt the dll in Visual Studio 2013 but get the same results. I'm on Unity 4.6.1 with a P2314T dell touchscreen.
Hi dansav. I've never gotten the touch plugin to work with the Unity Editor. The plugin requires that you point it to a window name and I've never come up with what that would be while working in the Editor.
If you're having issues with your builds, then you may need to check a couple things. One is making sure that you are setting the "Product Name" in the Unity PlayerSettings the same as the string that you're passing to the plugin. The plugin looks for a window name of that string to retrieve touch data from.
Thanks for that tip. $$anonymous$$aybe I could change his VS plugin code that compares the name. It's either pData->pName, or NewName that is the name of the window? $$anonymous$$now of anyway to send the names back to unity?
BOOL CALLBAC$$anonymous$$ EnumWindowsFunc( In HWND hwnd, In LPARA$$anonymous$$ lParam ) { tWindowData pData = (tWindowData )lParam; char NewName[128]; GetWindowText(hwnd, NewName, 128); if (!strcmp(pData->pName, NewName)) { pData->Handle = hwnd; return false; } return true;
}
Is there a way to send a Debug.Log to unity from the dll? If so I could Debug.Log all the windows names.
I've used powershell and cmd to trace all the Window names but none of them worked for the editor.
You don't have to change anything about the pluginto get it to work for builds though. You just need to pass it the name of the window you want to use with the Initialise function. So if you wanted to Initialize the plugin with a window name of "$$anonymous$$yGame", you'd Initialise("$$anonymous$$yGame");. Check out the images below, they give you example code from Steve Hughes blog that should clear things up.
Thanks. I have the scene and project named TouchTest and that's the Str in the code also. I was able to get it working in a build, but at first it said Number of Touches= 128 in the Editor. Then mysteriously after doing a build it changed to the correct amount. It would still be nice to get the editor working, but it sounds like you've tried everything possible already. I tried a few other solutions in the asset store but most of the authors have disappeared.
Your answer
![](https://koobas.hobune.stream/wayback/20220613130304im_/https://answers.unity.com/themes/thub/images/avi.jpg)