HP Dx9000 Resources for Developing Touch-Friendly Applications for HP Business - Page 14

Gestures - multitouch

Page 14 highlights

messages, or you may need to override the default behavior of the default legacy messages in your application. You can also choose to wow your users with the best touch experience by having your application register for touch input messages to handle them. The lowest level raw touch data provided by Windows Touch API allows you to detect the action, identify each touch point, its position and contact area. You then can calculate the physic aspects of user touch actions and simulate lively physic responses engaging the user actions. With touch input messages, you can also choose to provide event sinks for manipulation processors and inertia processors. This mechanism helps the animation of complex gestures like rotation and translation at the same time, deceleration of objects on their trajectories, bouncing off effects when hitting a boundary, etc. At the release of Windows 7, with WPF 3.5 SP1 the development support for new multi-touch features is available for native code via Win32 and COM. WPF 4.0 is expected to have support for all multi-touch features. In the interim, WPF application developers have the following options:  Use .NET wrappers in Windows 7 Multitouch .NET Interop Sample Library or  Use stylus events The following sub-sections summarize the basics of handling gesture and touch input messages using unmanaged code. Subsequently you will note how to get multi-touch data in a WPF application. Code excerpts from MSDN and other sources are included for illustration. Gestures The following table lists the gestures defined in Windows 7 and the default synthesized messages on applications that do not handle gesture messages. Gesture Equivalent message Tap (down and up quickly) Double tap (down and up quickly twice) Select (down, move over target(s), up) Drag (down, move and up) Press and hold (down, pause until the blue ring appears around your finger then up) Press and tap (press one finger on the target, then quickly tap down the other finger. First finger needs to be on the target.) Two-finger tap (tap two fingers at the same time and the target is the midpoint between two fingers Panning (drag one or two fingers up and/or Mouse left-click Mouse double click Mouse select Mouse left-drag Mouse right-click Mouse right-click Not applicable Mouse scroll wheel 14

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37

14
messages, or you may need to override the default behavior of the default legacy
messages in your application.
You can also choose to wow your users with the best touch experience by having
your application register for touch input messages to handle them. The lowest level
raw touch data provided by Windows Touch API allows you to detect the action,
identify each touch point, its position and contact area.
You then can calculate the
physic aspects of user touch actions and simulate lively physic responses engaging
the user actions.
With touch input messages, you can also choose to provide event sinks for
manipulation processors and inertia processors. This mechanism helps the
animation of complex gestures like rotation and translation at the same time,
deceleration of objects on their trajectories, bouncing off effects when hitting a
boundary, etc.
At the release of Windows 7, with WPF 3.5 SP1 the development support for new
multi-touch features is available for native code via Win32 and COM. WPF 4.0 is
expected to have support for all multi-touch features. In the interim, WPF
application developers have the following options:
Use .NET wrappers in Windows 7
Multitouch .NET Interop Sample Library
or
Use stylus events
The following sub-sections summarize the basics of handling gesture and touch
input messages using unmanaged code. Subsequently you will note how to get
multi-touch data in a WPF application. Code excerpts from MSDN and other
sources are included for illustration.
Gestures
The following table lists the gestures defined in Windows 7 and the default
synthesized messages on applications that do not handle gesture messages.
Gesture
Equivalent message
Tap
(down and up quickly)
Mouse left-click
Double tap
(down and up quickly twice)
Mouse double click
Select
(down, move over target(s), up)
Mouse select
Drag
(down, move and up)
Mouse left-drag
Press and hold
(down, pause until the blue ring
appears around your finger then up)
Mouse right-click
Press and tap
(press one finger on the target, then
quickly tap down the other finger. First finger
needs to be on the target.)
Mouse right-click
Two-finger tap
(tap two fingers at the same time
and the target is the midpoint between two fingers
Not applicable
Panning
(drag one or two fingers up and/or
Mouse scroll wheel