Mouse with a scrolling wheel

Lukas Renggli renggli at hotmail.com
Sun Nov 10 17:43:53 UTC 2002


> But I could not find how I could map them.
> Any idea?

The Windows VM does this mapping in the file "sqWin32Window.c":

 /* RvL 1999-04-19 00:23
     MOUSE WHEELING START */
  if( WM_MOUSEWHEEL == message || g_WM_MOUSEWHEEL == message ) {
    /* Record mouse wheel msgs as CTRL-Up/Down */
    short zDelta = (short) HIWORD(wParam);
    if(inputSemaphoreIndex) {
      sqKeyboardEvent *evt = (sqKeyboardEvent*) nextEventPut();
      evt->type = EventTypeKeyboard;
      evt->timeStamp = lastMessage->time;
      evt->charCode = (zDelta > 0) ? 30 : 31;
      evt->pressCode = EventKeyChar;
      evt->modifiers = CtrlKeyBit;
      evt->reserved1 = evt->reserved2 = 0;
    } else {
      buttonState = 64;
      if (zDelta < 0) {
 recordVirtualKey(message,VK_DOWN,lParam);
      } else {
 recordVirtualKey(message,VK_UP,lParam);
      }
    }
    return 1;
  }
  /* MOUSE WHEELING END */

In fact, it just generates a new message that simulates pressing the
Command-upArrow or the Command-downArrow. Probably this is not implemented
in other VMs.

--
Lukas Renggli
http://renggli.freezope.org






More information about the Squeak-dev mailing list