HP Dx9000 Resources for Developing Touch-Friendly Applications for HP Business - Page 17
Touch Input Messages
UPC - 884420541578
View all HP Dx9000 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 17 highlights
ullArguments shows more information about the gesture (for example, the distance between the two points of a zoom) You can configure the gesture messages sent from Windows by calling SetGestureConfig. Typical usages are disabling/enabling gestures, blocking/receiving vertical/horizontal and gutter and inertia for single finger panning. A few things to consider when handling WM_GESTURE: Do not call RegisterTouchWindow. Your application will stop receiving WM_GESTURE messages. Ignore the gesture starting and ending messages (GID_BEGIN and GID_END). The default gesture handler uses these. Application behavior is undefined if your application consumes these. Pass unconsumed messages to DefWindowProc to ensure all messages are handled appropriately. Call CloseGestureInfoHandle to close the gesture input handle for messages that your application handles. Note that compound gestures are coalesced. For example, a touch gesture starting as a zoom then changing to panning will result in only a zoom gesture message. If you want to respond exactly to zooming then panning, you need to handle WM_TOUCH instead of WM_GESTURE and detect the gesture change yourself. More details about touch support in Windows 7® are available on MSDN at http://msdn.microsoft.com/en-us/library/dd562197(VS.85).aspx. Touch Input Messages Touch input messages gives you the raw touch data and all the freedom to interpret it. Associate the raw touch points to the target objects and figure out what action a user or users intend to do. The following unmanaged MSDN code excerpts show the different steps to getting touch input messages: test the capabilities of the input digitizer, register to receive touch input messages and handle the messages.Test the capability of the touchscreen: #include . . . // test for touch int value = GetSystemMetrics(SM_DIGITIZER); if (value & NID_READY){ /* stack ready */} if (value & NID_MULTI_INPUT){ /* digitizer is multitouch */ MessageBoxW(hWnd, L"Multitouch found", L"IsMulti!", MB_OK); } if (value & NID_INTEGRATED_TOUCH){ /* Integrated touch */} 17