330 likes | 584 Views
Developing Windows 7 based Multi-Touch Application. Ramaprasanna Chellamuthu Microsoft India. Agenda. Touch Hardware Key Touch Scenarios Windows 7 Touch Investments Touch Application Development Guidance Gesture Manipulation and Inertia Demo Resources. Multi-Touch….
E N D
Developing Windows 7 based Multi-Touch Application Ramaprasanna Chellamuthu Microsoft India
Agenda • Touch Hardware • Key Touch Scenarios • Windows 7 Touch Investments • Touch Application Development Guidance • Gesture • Manipulation and Inertia • Demo • Resources
Multi-Touch… • …creates new opportunities. • Software that is intuitive for users to walk up & master • Software that is collaborative with multiple users • …is not new. • Researchers have been exploring this stuff for decades • …is now going mainstream. • Hardware: Robust touch-capable hardware from Microsoft and OEMs • Dozens of Win7 touch devices now available • OS: Windows 7 has great touch support baked in • SDKs: Microsoft is making touch easy to leverage • You: Developers & designers creating innovative apps that take advantage of the technology
Windows Touch is here Windows Touch is defined as two or more independently traceable touch points. • Consumers • Touch interfaces have proven successful • Multi-Touch offers clear differentiation with a high “WOW” factor • Multi-touch enhances on-the-go use and enable new scenarios • Hardware • Multi-touch capable machines in market today in a broad set of form factors
Key Touch Scenarios Are Consumptive 1 • Navigating and Consuming the Web 2 • Reading and Sorting Email 3 • Viewing Photos 4 • Playing Casual Games 5 • Consuming Music and Video 6 Navigating Files and Using Applications
Windows Investment • Internet Explorer® • Pan and zoom gestures, flick forward/back • “Open link in new tab” gesture • Address bar drag menu • Windows® Media Center: • Live gallery panning • On-screen keyboard • Larger transport controls & seek • New Now Playing & details pages • Photo Viewer (& Windows Live Photo Gallery) • Multitouch Zoom and rotation • XPS Viewer • Stretch zoom centered around gesture • Smart zoom • Touch Pack for Windows 7
Windows 7 Principle: Be Great at “Look” and “Do” • Users have expectations for how an experience will “Look” and what it should “Do” • Direct Manipulation demands more from “Look” and “Do” • Touch Pack for Windows 7 • Surface Globe: Immersive, 2-D and 3-D touch world exploration: • Zoom in on locations • Pinpoint areas of interest • Get local information • Personalize map views
Gestures: Touch actions that are one step removed from direct manipulations Two finger tap Press and tap Pinch/stretch (zoom) Circular motion (rotate) Single and two-finger panning Flicks Useful for shortcut-like efficiency Consistent operations like zoom in, or navigate Focus on content : to surface extra information or invoke contextual action UI Design Considerations Consistency Should work in the same way across Windows applications Keep it simple – users won’t discover or remember too many abstractions Gestures: Consistency is key
WM_GESTURE • Windows Message and APIs: • WM_GESTURE, WM_GESTURENOTIFY • GESTURECONFIG struct • Set/GetGestureConfig() • GESTUREINFO • GetGestureinfo()
Setting Gestures and WM_GESTURE case WM_GESTURENOTIFY: { BOOL bResult; GESTURECONFIG gcAll[] = {0,GC_ALLGESTURES,0}; // Enable all gestures bResult = SetGestureConfig(hWnd, 0, 1, gcAll, sizeof(GESTURECONFIG)); } case WM_GESTURE: { GESTUREINFO gi; gi.cbSize = sizeof(gi); bResult = GetGestureInfo((HGESTUREINFO)lParam, &gi); switch (gi.dwID) { case GID_BEGIN: break; case GID_END: break; case GID_ZOOM: //GID_PAN, GID_ROTATE, GID_TWOFINGERTAP, GID_PRESSANDTAP break; }
WM_TOUCH • WM_TOUCH* family of messages • Enables touch-optimized experiences • Provides standard Win32 messages • WM_TOUCHDOWN, WM_TOUCHMOVE, WM_TOUCHUP • Semantically similar to mouse messages • Conveys raw touch data to Win32 apps Scenario examples: Finger painting, custom gestures, feeding higher level controls, etc
Manipulation Container IsManipulationEnabled=true IsManipulationEnabled=true • Handle ManipulationStarting Event • Set Manipulation Container Canvas Manipulation Container • Handle ManipulationDelta Event • Coordinates relative to Manipulation Container Update RenderTranform
Manipulation Events • Initialize: • Mode • Container • Pivot StartInertia() StartInertia() Completed()
Silverlight 3 Touch APIs - Listening • public partial class MainPage : UserControl • { • public MainPage() • { • ... • // listen to touch events from the system • Touch.FrameReported += • new TouchFrameEventHandler(OnFrame); • } • void OnFrame(object sender, TouchFrameEventArgs e) • { • // enumerate and respond to touch events • } • }
Silverlight 3 Touch APIs - Processing • void Touch_FrameReported(object sender, TouchFrameEventArgs e) • { • TouchPointCollectiontouchPoints = e.GetTouchPoints(LayoutRoot); • foreach (TouchPointtp in touchPoints) • { • if (tp.Action == TouchAction.Down) { • // a new touch has come down • } • if (tp.Action == TouchAction.Move) { • // a previously down touch has moved • } • if (tp.Action == TouchAction.Up) { • // a touch has been removed • } • } • }
Inertia Behaviors • Deceleration and Displacement/Rotation/Expansion mutually exclusive • Deceleration – useful to simulate friction • Displacement – useful on page flips • Default – no inertial movements
Surface is not just multi-touch • Windows 7 & WPF 4 are a great baseline for touch • Surface creates unique opportunities with specialized HW • Robust top • Horizontal form factor • Infrared camera array
Surface: Beyond Multi-Touch • Massive multi-touch • Multi-user experiences • Object recognition • Optical engineering
Surface: Multi-User • Trend: Software continues to reduce the need for face-to-face human interactions • Problem: Happiness and creativity depend on social interactions • Surface brings people together • Industrial design encourages users to gather • Input capabilities allow simultaneous use • Apps facilitate collaboration / competition
Surface: Massive Multi-Touch • Surface can efficiently track 50+ simultaneous fingers and objects
Surface: Objects • Uniquely identify & react to billions of tagged objects Byte Tags 256 unique values Identity Tags >340,282,366,920,938,000,000,000,000,000,000,000,000unique values • Tags include orientation indictors dots
Surface: Optics • Determine the size and shape of every input • See into and project onto physical objects
What’s next for Surface hardware? • Things we’re exploring: • Cheaper • Thinner • Vertical • Stay tuned…
Resources • Software Design • Windows User Experience Interaction Guidelines • Multi-Touch in Windows 7 • Developer Enhancements to Windows Touch and Tablet PC • (User Perceptions of Response Time) Performance UX Patterns • Developer Resources • Code Magazine: Multi-touch capabilities in Windows 7 • Windows Touch on MSDN • Windows Touch Developer Resources • Tablet and Touch SDK • Introducing the Microsoft Touch Pack for Windows 7
Resources Learning • Sessions On-Demand & Community • Microsoft Certification & Training Resources www.microsoft.com/teched www.microsoft.com/learning • Resources for IT Professionals • Resources for Developers • http://microsoft.com/technet • http://microsoft.com/msdn