XNA Support Gestures on Windows 7 - windows-phone-7

One of my friends is working on a Windows phone 7 game and XNA allow you to support gestures, now he wants to use the same code so the game will be supported on PC (Windows 7) i want to know how i support gestures on PC with a Touch Screen monitor, i have been looking on the web but apparently this is not so common.
So far the only reference that i have is to recreate the Touch class on C++, that's is not an option on time and budget
Maybe i am missing something obvious please help.

What I know is that a touch screen monitor needs to be handled as a mouse, so your friend needs to change all his gestures with MouseState and detecting left button clicks.
You just need to replace TouchLocations with the location of the pointer.

Related

How to recognize mouse wheel in MAUI view for desktop application

How to get notified for mouse wheel interaction for MacCatalyst and windows at MAUI platform.
Answer 1: Scrolling.
What do you want to do based on mouse wheel interaction? If you simply want to scroll, or know when scrolling has occurred, then you can rely on ScrollView, and other views that handle scrolling themselves. E.g. ScrollView.Scrolled event.
Answer 2: General use of mouse scroll wheel.
Input functionality for mouse or keyboard has not yet been implemented in MAUI. Nor has a specification been finalized.
Here is one mouse proposal.
You could add a comment to that proposal requesting that mouse wheel support be included.
However, this might not be in the first release of MAUI, as the current emphasis is on stabilizing the functionality that is needed on all platforms (including mobile), some of which don't have mice.
In case anyone is wondering "shouldn't this be specified in .net 6?" (And then MAUI would simply use it.)
There are interactions between what is happening on the display (views or windows) and how mouse/keyboard input should be handled - it makes sense to put that input in the same code base that is displaying to the screen - therefore MAUI is a good place for it.
Especially given that touch is part of MAUI.
Until then, the solution is to make a DependencyService on each platform, to refer to the platform's APIs that you need.
Surprisingly, I'm not finding one that anyone has done for mouse on Windows and Mac.
Other than "implicitly", since a mouse can be used similar to a touch device. And text can be typed on a keyboard. The point is that there is no API specific to functionality that only makes sense if you have a physical mouse (scroll wheel) or a physical keyboard (global keyboard hooks).
TBD I'll look into this further.
Basic approach would be to look at what WinUI 3 uses as input APIs.
On Windows Desktop app, forward to those input APIs. Write an adapter on other platforms (Mac, Linux).
I'll see if Uno Platform or Avalonia have taken this approach.

How to detect tap on Windows phone

I want to detect the tap on the phone (Windows 7 OS), but not on the touch screen (probably on the side of the device). I am not sure whether it could be implemented with the accelerometer data. any idea?
It depends on the app, but probably we can consider Tap as Shake. If so take a look on
Shake that Windows Phone 7 and detect it
Windows Phone Shake Gestures Library
or similar. There is a ShakeGestureEventArgs arg that holds a ShakeType property that identifies the direction of the shake gesture.

How to make the picture follow my finger WP7 Silverlight?

Something like dragging and dropping an image
Is there a basic sample that I can use for that purpose?
You can use OnManipulationStarter, OnManipulationDelta and OnManipulationCompleted events with TranslateTransform on some object to move it below your finger.
Also, advanced stuff will be MultiTouch Behavior for Windows Phone 7

Guide.BeginShowKeyboardInput and tap to correct bar?

With XNA and Windows Phone, using Guide.BeginShowKeyboardInput doesn't seem to use the native "tap to correct words" bar.
Is there any way to get it to show up, or is it a current XNA 4.0 limitation on Windows Phone?
From this article:
If your application requires keyboard support, then you should consider Silverlight. Silverlight applications get access to the software keyboard by default, but for games made with XNA Game Studio, developers need to build their own software keyboard control to enable keyboard input.
With XNA, you can only use Guide.BeginShowKeyboardInput, and this doesn't have the functionality you desire.

Panning and zooming over a large image just like in Bing Map control

I am looking for a solution where I am able to do all the gestures (flick, pinch, drag) with a local picture in my Windows Phone 7 application with acceptable performance. The Silverlight Bing Map control for WP7 does all of this perfectly, but it cannot do this with a local image.
I started to write my own control, but I was wondering if there is anything out there written by someone else. Is there anything out there?
Is it possible to reuse the Map control, but with my own image?
Laurent Bugnion's Multitouch Behaviour from beta might also be worth a look for this purpose.
MultiTouch Behavior for Windows Phone 7
MultiTouch Behavior: Update for Windows Phone 7 tools beta
You need a MultiScaleImage. You can use this with DeepZoom.
There's an (old) example here.

Resources