mono / xwt

A cross-platform UI toolkit for creating desktop applications with .NET and Mono
MIT License
1.36k stars 241 forks source link

Multi-touch events #516

Open Gerharddc opened 9 years ago

Gerharddc commented 9 years ago

Is there any way to receive touch events using XWT? I am referring specifically to the multi-touch events that can be generated by WPF and GTK. I guess maybe those generated by the OSX multi-touch trackpads could also be useful.

sevoku commented 9 years ago

Xwt has no support for touch events. I was planning to make some research and to add some basic api, but I have no time for it atm. See #406, too.

Gerharddc commented 9 years ago

Ok I might look into adding it myself if I have the time. I have already done some research though and this should be fairly easy on WPF for Windows. GTK# will be a problem though because the current version of Gtk+ that has been wrapped does not appear to have touch events. Someone will have to update Gtk# first. After that it should be easy. On OSX there is off course no such thing as a touch screen but if I have read it correctly then Gtk+ can/might/will maybe recognize gestures from the multi-touch trackpads. But again this will only be after an update on that side.

sevoku commented 9 years ago

I have no ea about Wpf, but Gtk seems to be possible. The major problem is Gtk#, you're right. There seems to be a PR (mono/gtk-sharp#128) for 3.12, but I have no idea if it works and contains the touch event + structures. And the gtk-sharp repo has not been updated since jan 2014. The other problem is, that if gtk-sharp gets the right apis, it would take pretty long time until the packages (linux/windows/mac) get updated. So I was thinking about mapping the events using GLib and adding the structures directly to Xwt.Gtk3. With some version checks it should be pretty easy with the current gtk-sharp without the apis, but I had no time for more work on this.

sevoku commented 9 years ago

And I forgot: the main challange is to create some unified Touch-API in core Xwt. I don't know how different the native implementations are.

Gerharddc commented 9 years ago

@sevoku I'll check out glib if I ever get time to try and work on this myself. What I can tell you from experience though is that a basic touch API that offers just a bunch of touch points with movement deltas and coordinates should be implementable for all platforms and be very helpful. All that is then needed is a touchstart, touchchange, and touchend event on a surface with these points passed as an array parameter. This is one way that I believe Qt, which run ons almost any platform, offers touch.

lytico commented 9 years ago

I plan an implemenation based on this: http://www.w3.org/TR/pointerevents

lytico commented 9 years ago

first proposal: https://github.com/mono/xwt/pull/523

harry-cpp commented 9 years ago

There seems to be a PR (mono/gtk-sharp#128) for 3.12

Actually it's for 3.14, I've been using their repo (https://github.com/openmedicus/gtk-sharp) for few months now and it's really good.