<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://jogamp.org/bugzilla/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.2"
          urlbase="https://jogamp.org/bugzilla/"
          
          maintainer="sgothel@jausoft.com"
>

    <bug>
          <bug_id>800</bug_id>
          
          <creation_ts>2013-08-05 15:11:52 +0200</creation_ts>
          <short_desc>Add Windows 7 Touch Event Support to Generate NEWT Mouse/Pointer Events</short_desc>
          <delta_ts>2013-10-17 23:03:02 +0200</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>JogAmp</classification>
          <product>Newt</product>
          <component>windows_8</component>
          <version>1</version>
          <rep_platform>All</rep_platform>
          <op_sys>all</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>---</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>861</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Sven Gothel">sgothel</reporter>
          <assigned_to name="Sven Gothel">sgothel</assigned_to>
          <cc>gouessej</cc>
    
    <cc>rami.santina</cc>
          
          <cf_type>---</cf_type>
          <cf_scm_refs>gluegen 43e5b14bfd0d7ec53bd3c7634e6e95af8ea2afb1
jogl 5b96486da0bcd09d5355f89ec551140e508b567c
jogl 119133e89831fc837015b3f6fd7b258077c93d46
jogl 3c56d9346b9077b5eb65ec9e111917cfe17e9173</cf_scm_refs>
          <cf_workaround>---</cf_workaround>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2856</commentid>
    <comment_count>0</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2013-08-05 15:11:52 +0200</bug_when>
    <thetext>Windows 8 API supports touch events, which shall be supported by NEWT
to generate NEWT&apos;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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2863</commentid>
    <comment_count>1</comment_count>
    <who name="Julien Gouesse">gouessej</who>
    <bug_when>2013-08-05 16:48:47 +0200</bug_when>
    <thetext>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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2869</commentid>
    <comment_count>2</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2013-08-05 17:26:32 +0200</bug_when>
    <thetext>(In reply to comment #1)
&gt; Using WM_TOUCH messages should work both under Windows 7 and 8:
&gt; http://msdn.microsoft.com/en-us/library/windows/desktop/dd317341%28v=vs.
&gt; 85%29.aspx

If that is true .. and multi touch is supported .. I guess we are good - puhh :)
Will check this later on.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2870</commentid>
    <comment_count>3</comment_count>
    <who name="Julien Gouesse">gouessej</who>
    <bug_when>2013-08-05 17:30:52 +0200</bug_when>
    <thetext>You can handle the gestures too but with another message.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3108</commentid>
    <comment_count>4</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2013-10-13 17:46:05 +0200</bug_when>
    <thetext>GlueGen native compilation: Enable Win 7 definitions via WINVER/_WIN32_NT 0x0601</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3109</commentid>
    <comment_count>5</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2013-10-14 08:53:36 +0200</bug_when>
    <thetext>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 &apos;pointer event&apos;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3110</commentid>
    <comment_count>6</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2013-10-14 08:54:03 +0200</bug_when>
    <thetext>(validated w/ desktop Win7 and Surface Win8)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3115</commentid>
    <comment_count>7</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2013-10-17 20:05:05 +0200</bug_when>
    <thetext>    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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3117</commentid>
    <comment_count>8</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2013-10-17 23:03:02 +0200</bug_when>
    <thetext>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 &apos;touchDownLastUp&apos;, and don&apos;t act on LBUTTON[UP|DOWN] and MOUSEMOVE if just lifted last finger
    
    - don&apos;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&apos;t send TOUCH event</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>