Mouse Wheel Events - Step 2 of 3: EventSensor

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Mouse Wheel Events - Step 2 of 3: EventSensor

marcel.taeumel
Hi, there.

Please find attached a change set that:

(0. Merges several peek* and prim* methods in EventSensor as a clean-up.)
1. Extends EventSensor to be prepared for VMs to really send mouse-wheel events.
2. Account for those changes in HandMorph.
3. Support #wheelDelta in MouseWheelEvent instances for fine-granular scrolling. Do only raise flags for, e.g., #isWheelUp and #isWheelDown if the delta is above 120 units [1]. Accumulate this in MouseWheelState.

Thanks to Bert and Tim (F.) for the discuss to specify the low-level format:

{
   7. "EventTypeMouseWheel"
   stamp.
   deltaX. "VM converts OS values into multiples of 120 units per notch"
   deltaY. "(see above)"
   buttons. "like mouse event"
   modifiers. "like mouse event"
   nil. "unused"
   window index.
}

Here is the change set: mouse-wheel-event-sensor.cs

Step 3 of 3 is to extend the VMs. :-)

Best,
Marcel

[1] https://developer.mozilla.org/en-US/docs/Web/Events/mousewheel#Chrome
Reply | Threaded
Open this post in threaded view
|

Re: Mouse Wheel Events - Step 2 of 3: EventSensor

timfelgentreff
Yay, thanks Marcel!

Already added to RSqueak/VM :)

marcel.taeumel wrote
Hi, there.

Please find attached a change set that:

(0. Merges several peek* and prim* methods in EventSensor as a clean-up.)
1. Extends EventSensor to be prepared for VMs to really send mouse-wheel events.
2. Account for those changes in HandMorph.
3. Support #wheelDelta in MouseWheelEvent instances for fine-granular scrolling. Do only raise flags for, e.g., #isWheelUp and #isWheelDown if the delta is above 120 units [1]. Accumulate this in MouseWheelState.

Thanks to Bert and Tim (F.) for the discuss to specify the low-level format:

{
   7. "EventTypeMouseWheel"
   stamp.
   deltaX. "VM converts OS values into multiples of 120 units per notch"
   deltaY. "(see above)"
   buttons. "like mouse event"
   modifiers. "like mouse event"
   nil. "unused"
   window index.
}

Here is the change set: mouse-wheel-event-sensor.cs

Step 3 of 3 is to extend the VMs. :-)

Best,
Marcel

[1] https://developer.mozilla.org/en-US/docs/Web/Events/mousewheel#Chrome