Windows 8 API supports touch events, which shall be supported by NEWT to generate NEWT's Mouse/Pointer events. It has to be evaluated whether this goal can be reached by extending the current use of the Win32 API (HWND/HDC/..) or whether we are required to add a new Windows 8 API binding.
Using WM_TOUCH messages should work both under Windows 7 and 8: http://msdn.microsoft.com/en-us/library/windows/desktop/dd317341%28v=vs.85%29.aspx
(In reply to comment #1) > Using WM_TOUCH messages should work both under Windows 7 and 8: > http://msdn.microsoft.com/en-us/library/windows/desktop/dd317341%28v=vs. > 85%29.aspx If that is true .. and multi touch is supported .. I guess we are good - puhh :) Will check this later on.
You can handle the gestures too but with another message.
GlueGen native compilation: Enable Win 7 definitions via WINVER/_WIN32_NT 0x0601
Success w/ WM_TOUCH: - availability detection - enabling if available - retrieving multi-touch events - multiple pointer per one WM_TOUCH So the worst scenario, i.e. new windows API is off the table - great. Now working on parsing the multiple pointer of one WM_TOUCH to produce a valid NEWT 'pointer event'.
(validated w/ desktop Win7 and Surface Win8)
Native: - WindowUserData tracks: - window size - mouse inside - pointer touch-down count and flags whether multiple-touch is supported. - Suppress WM_*BUTTON* events if within TOUCH operations, e.g. fingers are pressed, or if event is determined as TOUCH (0 != GetMessageExtraInfo()) - MOUSEMOVE issues NewtWindows_trackPointerLeave(..) directly if no TOUCH operation is in process. Removes need for MouseListener on Java side. - TOUCH events are send as follows: - PRIMARY first - 1 MOVE 2nd (if not sent already) - UP/DOWN (if not sent already) We only send max. one MOVE event, since Win7 / Win8 assignes MOVE per default, even if no actual move happened. Hence a single MOVE event shall suffice and is compatible w/ e.g. Android (AFAIK). - TOUCH pointer names are mapped to consecutive IDs on the java side.
Windows 7 Touch Event Support for NEWT: Fix Focus and LBUTTON[DOWN|UP] issues - w/ TOUCH, Win8 may steal focus (KILLFOCUS), quickly grab FOCUS again when on TOUCH operation - track 'touchDownLastUp', and don't act on LBUTTON[UP|DOWN] and MOUSEMOVE if just lifted last finger - don't use GetMessageExtraInfo() to distinguish MOUSE/TOUCH, simply use tracked touchDownCount - Also track mouseInside in TOUCH operation, i.e. true if _all_ fingers are inside, otherwise don't send TOUCH event