How to get TouchEvent on Windows desktop for OpenFL app? - windows

I'm on a touch enabled Windows machine compiling OpenFL. I'm compiling to the Windows/C++ target using OpenFL and Haxe 3.
I cannot get touch events to work. Here's where I'm adding them:
private function onAdded(e:Event):Void
{
stage.addEventListener(Event.RESIZE, resize);
resize(null);
init();
addEventListener( Event.ENTER_FRAME, onEnterFrame);
addEventListener( TouchEvent.TOUCH_BEGIN, onTouchBegin );
stage.addEventListener( TouchEvent.TOUCH_MOVE, onTouchMove );
stage.addEventListener( TouchEvent.TOUCH_END, onTouchEnd );
}
My enterFrame() is getting invoked just fine. No touch (or using mouse) triggers the handlers. Is this a Windows desktop limitation? Would this work once I put on iOS and Android? Why not? Is this a NME/OpenFL bug?

You can use mouse in place of touch on windows for now with the 1.1 update, until full support for multitouch is implemented. Works fine for iOS and Android etc.
singmajesty on the forum
Try it the other way, use a MouseEvent to handle both mouse and touch input on a desktop.
We just (in OpenFL 1.1, released this week) migrated to SDL2 for the backend for Windows. This actually has support for real touch events, so in the future I expect to see multi-touch support for the desktop. It just was not that long ago that this was only a thing for mobile devices smiling
So if you don't need to track individual touch points separately, mouse events should do it for you today. Otherwise, we're positioned now to be able to wire support for this in the not-too-distant future smiling

Related

Cobalt app support for Android touch screen devices

As of now , cobalt app works fine with RCU for Android TV's. If we try to test the same app in any touch screen devices, functionality doesn't works properly.
Is there any way to build Android cobalt app for touch screen devices.
Below are the major issues on touch devices.
Cant scroll
Not able to pause/resume the video
Most likely, your Starboard implementation doesn't emit touch or mouse events. See kSbInputDeviceTypeTouchScreen and kSbInputDeviceTypeMouse in https://cobalt.dev/reference/starboard/modules/input.html. For example of mouse implementation, see
https://cobalt.googlesource.com/cobalt/+/refs/heads/master/starboard/android/shared/input_events_generator.cc.

Unity Game View support Touch Events?

I would like to buy me a Microsoft Surfacebook. But bevore I would like to know if Unity IDE support Touch Events in the Game View of the Editor? Or only if a real device is connect? But the monitor itselft is a touch device.
Thanks for help!
Regards,
Markus
Few days, there was a similar question about touch detection in Unity using Windows tablets.
There is no support for the touch. Input.touches and Input.GetTouch will not work in the Editor Game View. It will only work when you deploy the Game.
For some reason, touches are treated as mouse input.
This shouldn't be a problem at-all because Input.mousePosition and OnMouseDown will work on it so you can use pre-processor to detect when in Editor mode then use input.mousePosition and OnMouseDown and then be able to test your app without having to build it.
Everything else should be fine. Remember, it is not a real computer. It is a mobile computer and is weaker than a real computer. Don't expect a 4K texture game to run smoothly on this device.

Disabling 'hover' in Windows 8 Simulator in Touch mode

I'm using the Windows 8 Simulator to do some testing of my website in IE10 using touch. However, when I select the single point (basic) touch mode (or any touch mode, for that matter), I find that Windows (and IE) still generate hover events. What I really want to do is test as if I was on a purely touch system with no support for hover.
Is it possible to adjust the Simulator so that it only responds to taps and related events, and not hover?

How to simulate touch events in Windows 7?

I would like to use the touch controller in windows 7.Actually i will get the touch coordinates as bluetooth packets accordingly using these coordinates to generate corresponding touches in OS as human mouse click or touches do.So how to start up with this.How could i register for touch events on windows7 os.
Download and install Microsoft Surface SDK 2.0. It includes a little software called Microsoft Surface Input Simulator which simulates touch events and some other things in Windows.
http://www.microsoft.com/en-us/download/details.aspx?id=26716
EDIT: I know this question is over a year old, but I thought it could help others.
There are some open source virtual touch drivers that you can use to simulate touch input if you don't have a touch input device
http://multitouchvista.codeplex.com/
http://code.google.com/p/vmulti/

What devices are available to test WM_GESTURE and WM_TOUCH code on a desktop machine?

I'm writing some code to handle WM_GESTURE and WM_TOUCH events in Windows 7, but I can't figure out how to test it. I do my development in Boot Camp on a 17" Mac Book Pro.
So far, I have determined that the Boot Camp trackpad driver in Windows 7 does not generate those events, and this generic trackpad I found on Amazon.com that claims to be 'multi-touch' works as advertised, but not by creating WM_GESTURE or WM_TOUCH events. I verified this by using Spy++ to report the events; nothing with the WM_GESTURE or WM_TOUCH value was reported.
What kind of hardware is supposed to generate these kinds of events? At this point, I'm assuming it's only for tablet or mobile (Windows CE) hardware, but I'd appreciate any other suggestions.
I suppose there's another way to approach this -- I want to get functionality similar to Cocoa's [NSResponder swipeWithGesture:] and related methods, which report back swipes, rotation, and other gestures on the trackpad. WM_GESTURE appears to be the equivalent on Windows 7.
An other option, which would require only another physical mouse device to work with, and should get you at least 95% of the way there is the Multi-Touch Vista project, which can emulate up to 256 touch points using physical devices - thus the need for an extra mouse, or two since it can be awkward to simultaneously work with a mouse in one hand and trackpad with another.
There are several monitors out there supporting touch with Windows 7. For example: Acer T230H.
HTH
Wacom makes several touchpads that support multitouch; a particularly inexpensive version is the Bamboo Touch. This gives you touch without having to buy another monitor - although it doesn't give that direct interaction feeling.

Resources