mouse-moved

Generic Function

Package: common-graphics

Arguments: window buttons cursor-position

This function is called when a mouse-moved event happens on window. buttons is an integer representing the state of mouse button(s) and keypad (see below). Bits in the buttons represent the state of modifier keys: 1 indicating that the key is down and 0 that it is up.

cursor-position is the mouse cursor position in the user coordinates of window that is, a position object indicating the distance of the mouse cursor at the time of the event from the top left corner of the (possibly scrolled) page of the window to which this message was sent. See the note below: this value becomes invalid when the mouse-moved method returned.

The following table shows the correspondence of buttons and keys to constants defined in Allegro CL for Windows.

Button/Key Associated Constant

left button left-mouse-button

middle button middle-mouse-button

right button right-mouse-button

shift key shift-key

control key control-key

alt key alt-key

Note (incompatible change in release 6.0): the cursor-position argument now becomes invalid after the method returns, to avoid consing a position object for every mouse-moved event (since many of them can occur each second). If an application needs to keep around the position argument of a mouse-moved method after the method returns, then it should copy the position (by calling copy-position) and save the copy.

This also applies if an application is still using the deprecated generic function event when the message argument is the value of the constant mouse-moved; in this case the data argument is the position that must not be referenced after the event method returns.

See About events in the IDE in cgide.htm.

Common Graphics and IDE documentation is described in About Common Graphics and IDE documentation in cgide.htm.

The documentation is described in introduction.htm and the index is in index.htm.

Copyright (c) 1998-2000, Franz Inc. Berkeley, CA., USA. All rights reserved.

Created 2000.10.5.