sinisterchipmunk / jax

Framework for creating rich WebGL-enabled applications using JavaScript and Ruby
http://jaxgl.com
MIT License
96 stars 16 forks source link

A built in mouse_scrolled event would be nice #62

Closed nat-n closed 11 years ago

nat-n commented 12 years ago

I'm not sure how the events work in JAX (the documentation seems to be outdated), but it could be handing to have a mouse_scrolled event along side the other handy events handlers.

It would probably be necessary to allow the user to specify whether the event should be blocked/bubbled after capture, (which event.preventDefault() seems to achieve best) and so whether or not the user can still scroll the window whilst over the canvas.

sinisterchipmunk commented 12 years ago

This is a good idea. It fits well with the Jax event model.

I would like to wait until after 3.0 is released, and am trying not to add more features to 3.0 itself. Same goes for pull requests: the event handlers in 3.0 are utterly different from earlier versions, so I think it's best to apply any feature commits to the new code base rather than the 2.x branch, which is basically going to be locked to bug fixes at this point.

sinisterchipmunk commented 11 years ago

Changed my mind on this while working on getting 3.0 out the door. I merged the implementation by @lutangar and added firefox support and some basic event normalization.

The controller action is mouse_rolled.

Commits:

3d84fa1f5abe331de344b67b970a23e94d05f4be Merge remote branch 'lutangar/wheel_events' into mouse_wheel 3da14f1e72a4b3129edd5eda5e6120148029fca3 normalize scroll events across chrome, firefox; demonstrate scrolling 1c475b66d755468052197e6326b7811266b9ffb5 update changelog