简体   繁体   中英

Two-finger panning with WM_POINTER based touch

I'm working on Windows 8, c++, with the WM_POINTER touch mechanism (and context interaction callback). My question is - how can I differentiate between a zoom operation and a two-finger pan operation?

Thanks, yakobom

AFAIK, if you are using this low-level mechanism, you need to do the "math" yourself. You need to detect each pointer separately (each has an id) and figure out where they are in relation to one another. After you calculate distance, deltas etc, you can make assumptions as to what the user was gesturing.

WM_GESTURE gives you the ability to detect higher-level touch events (zoom, pan) and does the calc for you: http://msdn.microsoft.com/en-us/library/dd353242(VS.85).aspx

As far as I know, WM_GESTURE and WM_TOUCH are mutually exclusive.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM