<?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>413</bug_id>
          
          <creation_ts>2010-09-11 16:02:28 +0200</creation_ts>
          <short_desc>mouseWheelMoved event is never generated</short_desc>
          <delta_ts>2011-12-07 01:48:20 +0100</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>JogAmp</classification>
          <product>Newt</product>
          <component>core</component>
          <version>1</version>
          <rep_platform>All</rep_platform>
          <op_sys>all</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Kraft">kraft.aralya</reporter>
          <assigned_to name="Sven Gothel">sgothel</assigned_to>
          <cc>bienator</cc>
    
    <cc>gouessej</cc>
    
    <cc>sgothel</cc>
    
    <cc>trog</cc>
          
          <cf_type>---</cf_type>
          <cf_scm_refs>30c959a4534bc0c6b4718ae65fd4f91d68d6eca6</cf_scm_refs>
          <cf_workaround>---</cf_workaround>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>496</commentid>
    <comment_count>0</comment_count>
      <attachid>153</attachid>
    <who name="Kraft">kraft.aralya</who>
    <bug_when>2010-09-11 16:02:28 +0200</bug_when>
    <thetext>Created attachment 153
Source code to demonstrate the bug

In a simple com.jogamp.newt.opengl.GLWindow,with a MouseListener listening to mouse events, when the user rolls the mouse, instead of calling mouseWheelMoved(), the methods mousePressed() and mouseReleased() are called.

Not critical but still annoying since the method mouseWheelMoved() exists.
We expect the method to be called when the event happens...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>498</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Bien">bienator</who>
    <bug_when>2010-09-11 16:13:07 +0200</bug_when>
    <thetext>*** Bug 382 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>499</commentid>
    <comment_count>2</comment_count>
    <who name="Kraft">kraft.aralya</who>
    <bug_when>2010-09-11 16:14:22 +0200</bug_when>
    <thetext>Forgot to mention :

i was using jogl-2.0-pre-20100831-linux-i586
on Ubuntu 10.04 with sun jdk</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>500</commentid>
    <comment_count>3</comment_count>
    <who name="Trog">trog</who>
    <bug_when>2010-09-15 12:29:08 +0200</bug_when>
    <thetext>I have the same problem. :-(</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>501</commentid>
    <comment_count>4</comment_count>
    <who name="Trog">trog</who>
    <bug_when>2010-09-16 08:14:19 +0200</bug_when>
    <thetext>I&apos;m using: jogl-2.0-pre-20100611-linux-i586.zip.

&gt; java -version
java version &quot;1.6.0_20&quot;
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) Server VM (build 16.3-b01, mixed mode)

OS: Gentoo GNU linux.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1148</commentid>
    <comment_count>5</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2011-10-24 20:42:32 +0200</bug_when>
    <thetext>On Monday, October 24, 2011 08:31:26 PM gouessej [via jogamp] wrote:
&gt; 
&gt; Hi
&gt; 
&gt; This bug prevents me from porting the pre-beta version of TUER to JOGL 2.0:
&gt; 
&gt; A mouse pressed event with MouseEvent.BUTTON4 is generated instead of a
&gt; mouse wheel event. Sven, do you know how to fix this bug?

No, but it rings a bell now.

While still @ Sun, we had a &apos;discussion&apos; whether to use a dedicated &apos;wheel&apos;
event or just representing them as another &apos;button&apos;.

Well, I favored the latter since it&apos;s a more generic approach, 
plus we really cannot tell what-else game-pads may have.
Technically it&apos;s a button, hence a pass-through button representation 
is IMHO best. For sure I can be convinced otherwise with good (tech.) arguments.

Maybe we can make a checklist here how the wheel is
represented on the native platforms:

Android: None
X11: Usually button4 and button5
Windows: ?
OSX: ?

If they all use a button representation, I guess it&apos;s best to remove the &apos;wheel&apos; ID.

Let me copy paste this email to the bugzilla entry, 
so we can continue it&apos;s discussion there (where it belongs IMHO).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1149</commentid>
    <comment_count>6</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2011-10-24 21:04:03 +0200</bug_when>
    <thetext>Windows: 
  - WM_MOUSEWHEEL:
    - x/y position 
    - rotation: (jint) ( GET_WHEEL_DELTA_WPARAM(wParam) / 120.0f ) 

+++

http://msdn.microsoft.com/en-us/library/windows/desktop/ms645617%28v=vs.85%29.aspx

The high-order word indicates the distance the wheel is rotated, expressed in multiples or divisions of WHEEL_DELTA, which is 120. A positive value indicates that the wheel was rotated forward, away from the user; a negative value indicates that the wheel was rotated backward, toward the user.

+++

http://msdn.microsoft.com/en-us/library/ms646273%28v=vs.85%29.aspx

If dwFlags contains MOUSEEVENTF_WHEEL, then mouseData specifies the amount of wheel movement. A positive value indicates that the wheel was rotated forward, away from the user; a negative value indicates that the wheel was rotated backward, toward the user. One wheel click is defined as WHEEL_DELTA, which is 120.

Windows Vista: If dwFlags contains MOUSEEVENTF_HWHEEL, then dwData specifies the amount of wheel movement. A positive value indicates that the wheel was rotated to the right; a negative value indicates that the wheel was rotated to the left. One wheel click is defined as WHEEL_DELTA, which is 120.

+++

So I guess we can assume that the WHEEL_DELTA_PARAM is a positive or negative multiple of 120 ?

+++++++++++

X11: mouse button4/5 - we can pass each &apos;click&apos; as a mouseWheel event.

++++

MacOSX: NSScrollWheel .. w/ some &apos;complicated&apos; GetDeltaY() code ..

+++

Ok .. bottom line I guess is to generate mousewheel events for X11 and we would be done.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1150</commentid>
    <comment_count>7</comment_count>
    <who name="Julien Gouesse">gouessej</who>
    <bug_when>2011-10-24 21:16:55 +0200</bug_when>
    <thetext>X11:

(first wheel)
BUTTON4 -&gt; SCROLL UP
BUTTON5 -&gt; SCROLL DOWN
(second wheel)
BUTTON6 -&gt; SCROLL LEFT
BUTTON7 -&gt; SCROLL RIGHT</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1234</commentid>
    <comment_count>8</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2011-12-02 07:55:21 +0100</bug_when>
    <thetext>As Julien suggested, mapped the 4 X11 button to 2 mouse wheels (See X11Window.java).

&gt; 0: UP
&lt; 0: DOWN

Usually w/ events by 1 .. 

Updated the MouseEvent API doc as well.

See commit: 30c959a4534bc0c6b4718ae65fd4f91d68d6eca6</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1242</commentid>
    <comment_count>9</comment_count>
    <who name="Julien Gouesse">gouessej</who>
    <bug_when>2011-12-02 12:31:05 +0100</bug_when>
    <thetext>It&apos;s a very good piece of news. Thank you so much.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1246</commentid>
    <comment_count>10</comment_count>
    <who name="Julien Gouesse">gouessej</who>
    <bug_when>2011-12-05 23:03:16 +0100</bug_when>
    <thetext>I reopen this bug as mouseReleased(MouseEvent me) is still called when the mouse scroll is moved. The bug fix should consist in avoiding to generate any MouseEvent on release when the wheel position isn&apos;t zero.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1248</commentid>
    <comment_count>11</comment_count>
    <who name="Julien Gouesse">gouessej</who>
    <bug_when>2011-12-06 23:49:52 +0100</bug_when>
    <thetext>I get these logs when using the mouse scroll with the build 577:
doMouseEvent: enqueue false, wait false, EVENT_MOUSE_PRESSED, mod 0, pos 631/446, button 5, lastMousePosition: 631 / 446
consumeMouseEvent: event:         MouseEvent[EVENT_MOUSE_PRESSED, [I@1917a08/[I@1e2b67c, button 5, count 1, wheel rotation 0, pointer&lt;1&gt;[-1: 631 / 446 0.0p], InputEvent[modifiers: 0x0, NEWTEvent[sys:false, source:jogamp.newt.driver.x11.X11Window, when:1323211511376 d 1ms]]]
doMouseEvent: enqueue false, wait false, EVENT_MOUSE_RELEASED, mod 0, pos 631/446, button 5, lastMousePosition: 631 / 446
consumeMouseEvent: event:         MouseEvent[EVENT_MOUSE_RELEASED, [I@13ac14d/[I@68d505, button 5, count 1, wheel rotation 0, pointer&lt;1&gt;[-1: 631 / 446 0.0p], InputEvent[modifiers: 0x0, NEWTEvent[sys:false, source:jogamp.newt.driver.x11.X11Window, when:1323211511377 d 0ms]]]
doMouseEvent: synthesized MOUSE_CLICKED event: MouseEvent[EVENT_MOUSE_CLICKED, [I@7973e4/[I@1a79071, button 5, count 1, wheel rotation 0, pointer&lt;1&gt;[-1: 631 / 446 0.0p], InputEvent[modifiers: 0x0, NEWTEvent[sys:false, source:jogamp.newt.driver.x11.X11Window, when:1323211511377 d 0ms]]]
consumeMouseEvent: event:         MouseEvent[EVENT_MOUSE_CLICKED, [I@7973e4/[I@1a79071, button 5, count 1, wheel rotation 0, pointer&lt;1&gt;[-1: 631 / 446 0.0p], InputEvent[modifiers: 0x0, NEWTEvent[sys:false, source:jogamp.newt.driver.x11.X11Window, when:1323211511377 d 0ms]]]

You can see that there is no mouse wheel event.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1249</commentid>
    <comment_count>12</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2011-12-07 00:38:20 +0100</bug_when>
    <thetext>I haven&apos;t build on master while pushing out the rc branch to save time,
ie not kicking off a master branch build.

RC4: https://jogamp.org/chuck/view/RC/job/jogl-RC/44/
  sha1 30c959a4534bc0c6b4718ae65fd4f91d68d6eca6
  http://jogamp.org/git/?p=jogl.git;a=commit;h=30c959a4534bc0c6b4718ae65fd4f91d68d6eca6

577: https://jogamp.org/chuck/view/fwd/job/jogl/577/
  sha1 4856f7800bac165c3770495b77de4a2eabcca46e

  This one does not contain the mouse wheel tweak ..</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1250</commentid>
    <comment_count>13</comment_count>
    <who name="Julien Gouesse">gouessej</who>
    <bug_when>2011-12-07 00:46:30 +0100</bug_when>
    <thetext>I have noticed that a few minutes ago, sorry. I use the release candidate 4 and now it works fine. Thank you very much.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>153</attachid>
            <date>2010-09-11 16:02:28 +0200</date>
            <delta_ts>2010-09-11 16:02:28 +0200</delta_ts>
            <desc>Source code to demonstrate the bug</desc>
            <filename>TestNewt.java</filename>
            <type>text/x-java</type>
            <size>1524</size>
            <attacher name="Kraft">kraft.aralya</attacher>
            
              <data encoding="base64">CgppbXBvcnQgamF2YXgubWVkaWEub3BlbmdsLkdMQ2FwYWJpbGl0aWVzOwppbXBvcnQgamF2YXgu
bWVkaWEub3BlbmdsLkdMUHJvZmlsZTsKCmltcG9ydCBjb20uam9nYW1wLm5ld3QuZXZlbnQuTW91
c2VBZGFwdGVyOwppbXBvcnQgY29tLmpvZ2FtcC5uZXd0LmV2ZW50Lk1vdXNlRXZlbnQ7CmltcG9y
dCBjb20uam9nYW1wLm5ld3QuZXZlbnQuV2luZG93QWRhcHRlcjsKaW1wb3J0IGNvbS5qb2dhbXAu
bmV3dC5ldmVudC5XaW5kb3dFdmVudDsKaW1wb3J0IGNvbS5qb2dhbXAubmV3dC5vcGVuZ2wuR0xX
aW5kb3c7CgovKioKICogVGhpcyBzYW1wbGUgZGVtb25zdHJhdGVzIHRoYXQgd2hlbiB0aGUgdXNl
ciByb2xscyB0aGUgbW91c2Ugd2hlZWwsCiAqIGluc3RlYWQgb2YgY2FsbGluZyBtb3VzZVdoZWVs
TW92ZWQoKSwgdGhlIG1ldGhvZHMgbW91c2VQcmVzc2VkKCkgYW5kCiAqIG1vdXNlUmVsZWFzZWQo
KSBhcmUgY2F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ZCBtb3VzZVJlbGVhc2VkKE1vdXNlRXZl
bnQgYXJnMCkgewogICAgICAgIAkJU3lzdGVtLm91dC5wcmludGxuKCJtb3VzZVJlbGVhc2VkIik7
CiAgICAgICAgCX0KCiAgICAgICAgCXB1YmxpYyB2b2lkIG1vdXNlV2hlZWxNb3ZlZChNb3VzZUV2
ZW50IGFyZzApIHsKICAgICAgICAJCVN5c3RlbS5vdXQucHJpbnRsbigibW91c2VXaGVlbE1vdmVk
Iik7CiAgICAgICAgCX0KICAgICAgICB9CiAgICAgICAgKTsKCX0KCn0K
</data>

          </attachment>
      

    </bug>

</bugzilla>