CETOUCHINPUT (Compact 7)
3/12/2014
This structure contains information about a touch event.
Syntax
typedef struct {
LONG x;
LONG y;
HANDLE hSource;
DWORD dwID;
DWORD dwFlags;
DWORD dwMask;
DWORD dwTime;
DWORD cxContact;
DWORD cyContact;
DWORD dwPropertyOffset;
DWORD cbProperty;
} CETOUCHINPUT, *PCETOUCHINPUT;
Members
- X
Specifies the x coordinate of the touch point in fourths of a pixel.
- y
Specifies the y coordinate of the touch point in fourths of a pixel.
- hSource
Identifier of the touch input source. Reserved for use by the touch proxy.
- dwID
The touch point identifier, which is the touch contact index. This ID must be maintained for a contact from the time it goes down until the time it goes up.
dwFlags
A set of bit flags that specify various aspects of touch point press/release and motion. The bits in this member can be any reasonable combination of the following values.Flag Description TOUCHEVENTF_MOVE
Indicates that movement occurred. This flag can not be combined with TOUCHEVENTF_DOWN.
TOUCHEVENTF_DOWN
Indicates that the corresponding touch point was established through a new contact. This flag can not be combined with TOUCHEVENTF_MOVE or TOUCHEVENTF_UP.
TOUCHEVENTF_UP
Indicates that a touch point was removed.
TOUCHEVENTF_INRANGE
Indicates that a touch point is in range. This flag must be set with all TOUCHEVENTF_DOWN and TOUCHEVENTF_MOVE events.
TOUCHEVENTF_PRIMARY
Indicates that a touch point is designated as primary. This flag is reserved for use by the touch proxy DLL.
TOUCHEVENTF_NOCOALESCE
Indicates that the input must not be coalesced in the input stack.
TOUCHEVENTF_PEN
Indicates that the touch point is associated with a pen contact.
TOUCHEVENTF_CALIBRATED
Indicates to the input system that it is not necessary to further calibrate the x and y coordinates of the sample.
TOUCHEVENTF_SYMMETRIC
Indicates that the touch point is ambiguous because there are multiple contacts. While the touch controller hardware can recognize the x and y of each contact, it can not match them together. Essentially, the controller is symmetric and knows that there are contacts at x1, x2, y1, and y2, but it does not know which x is paired with which y. This flag is only set when there are multiple simultaneous contacts, if there was only a single contact the pairing would not be ambiguous.
dwMask
A set of bit flags that specify which of the optional fields in the structure contain valid values. This field can contain a combination of the following flags.Flag Description TOUCHINPUTMASKF_TIMEFROMSYSTEM
This flag is reserved for use by the operating system (OS).
TOUCHINPUTMASKF_CONTACTAREA
Indicates that the cxContact and cyContact fields are valid.
TOUCHINPUTMASKF_PROPERTY
Reserved.
- dwTime
Time stamp for the event in milliseconds. If this parameter is 0, the sample will be time stamped by GWES and the TOUCHEVENTMASKF_TIMEFROMSYSTEM flag will be set in dwMask.
- cxContact
Specifies the width of the touch contact area in fourths of a pixel.
- cyContact
Specifies the height of the touch contact area in fourths of a pixel.
- dwPropertyOffset
Reserved.
- cbProperty
Reserved.
Remarks
You can use the inline function ConvertTouchPanelToTouchInput in header file tchstream.h to convert touch panel sample flags and coordinates to a primary CETOUCHINPUT sample.
The platform dependent driver (PDD) must set the x, y, dwID, and dwFlags fields in each CETOUCHINPUT structure. All other fields are optional or ignored. Any fields that are not used should be set to zero.
A primary touch point is the first touch point to be established from a previous state of no touch points. The TOUCHEVENTF_PRIMARY flag is set for all subsequent events for the primary touch point. Once the primary touch point is released the TOUCHEVENTF_PRIMARY flag is no longer set. A TOUCHEVENTF_UP event on the primary touch point might not designate the end of a multi-touch operation. The multi-touch operation proceeds from the establishment of the primary touch point until the last touch point is released. The system mouse position follows the primary touch point and, in addition to touch messages, also generates WM_LBUTTONDOWN, WM_MOUSEMOVE, and WM_LBUTTONUP messages in response to actions on a primary touch point.
Note
The touch point identifier can be dynamic and is associated with a given touch point only as long as the touch point persists. If contact is broken and then resumed, the same touch point might receive a different touch point identifier.
Converting the touch coordinates contained in the CETOUCHINPUT structure into screen coordinates, or from screen coordinates to touch coordinates, requires the use of the TOUCH_SCALING_FACTOR defined in tchddi.h. Specifically, one touch point is a quarter of one screen coordinate, since the touch resolution is 4 times the screen resolution.
Requirements
Header |
tchddi.h |