[Vm-dev] Miss-understanding mousewheel events

Marcel Taeumel marcel.taeumel at hpi.de
Thu Dec 26 14:50:22 UTC 2019


Also note that "(lastMouseEvent buttonsĀ bitAnd: 7)" reads the #buttons fieldĀ  in the event object, which combines field 5 and 6 of the raw mouse-event array.

Best,
Marcel
Am 26.12.2019 15:48:23 schrieb Marcel Taeumel <marcel.taeumel at hpi.de>:
Hi Nicolas,

I tried to document that in EventSensor class comment:

...
Mouse-wheel event structure
==========================
Mouse-wheel events are generated when mouse-wheel input is detected.
[1] - event type 7
[2] - time stamp
[3] - horizontal scroll delta
[4] - vertical scroll delta
[5] - button state (same as in mouse events)
[6] - modifier keys (same as in mouse events)
[7] - reserved.
[8] - host window id.
...

SHIFT + RED + WHEEL-UP should be possible, right?

RED -> [5]
SHIFT -> [6]
WHEEL UP -> [3]

Best,
Marcel
Am 26.12.2019 00:42:49 schrieb Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com>:
Hi all,
I'm in my way of implementing mousewheel events on windows VM.

If I understand it correctly, we fill the buttons field of the event buffer
with modifiers states, and we don't fill the modifiers field of the event
buffer...

This sounds very strange to me.
See
https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/897ef1725e32c2eb3d24e3402b2e95b114b8b28b
(I've commented the lines that I find questionable)
Eliot, do you remember why?

It gives this image code:

generateMouseWheelEvent: evtBuf
...snip...
modifiers := evtBuf fifth.
buttons := (modifiers bitShift: 3) bitOr: (lastMouseEvent buttons
bitAnd: 7).

while other mouse events are:

generateMouseEvent: evtBuf
...snip...
buttons := evtBuf fifth.
modifiers := evtBuf sixth.

I'd be happy to see more uniformity, sixth field is not used.

Hi all,
I'm in my way of implementing mousewheel events on windows VM.

If I understand it correctly, we fill the buttons field of the event buffer with modifiers states, and we don't fill the modifiers field of the event buffer...

This sounds very strange to me.
See https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/897ef1725e32c2eb3d24e3402b2e95b114b8b28b [https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/897ef1725e32c2eb3d24e3402b2e95b114b8b28b]
(I've commented the lines that I find questionable)
Eliot, do you remember why?

It gives this image code:

generateMouseWheelEvent: evtBuf

...snip...

modifiers := evtBuf fifth.
buttons := (modifiers bitShift: 3) bitOr: (lastMouseEvent buttons bitAnd: 7).

while other mouse events are:

generateMouseEvent: evtBuf

...snip...

buttons := evtBuf fifth.
modifiers := evtBuf sixth.

I'd be happy to see more uniformity, sixth field is not used.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20191226/22d08557/attachment-0001.html>


More information about the Vm-dev mailing list