[FIX] Squeak win32 VM with Genius mouse driver misbehavior

Viktor Svub gilrandir at centrum.cz
Sun Feb 26 23:56:22 UTC 2006

I've found a minor bug in the Win32 SqueakVM, causing incorrect behavior
 with the 'Genius NetScroll[+] [Optical] Mouse' if using the
mouse-wheel: (scrolling works only down, scrolling up causes 'shaking'
or scrolls down).

In the "sqWin32Window.c" -> "MainWndProc", where the "WM_MOUSEWHEEL"
messages are translated to <ctrl-up> and <crtl-down> keystrokes (in
3.7.1 souces on line #218), the conditional expression is
"evt->charCode = (zDelta > 0) ? 30 : 31;", causing the zero to be
aligned as *negative* value. The Genius driver in it's enhanced mode
sends two messages for every wheel movement - first with maximal (+-120)
and second with minimal zDelta-value, but the driver treats *zero* as
the minimal positive value (-1 is the negative).
That may be also considered a bug, but the the fact is - zero *should
be* ever aligned as positive.
I've fixed this by reversing the condition:
"evt->charCode = (zDelta < 0) ? 31 : 30;" and it works well... it
shouldn't break anything, and it should be included in the next win32 VM
release, cause it affects Squeaks usability with a lot of Genius mouses.

More information about the Vm-dev mailing list