Generic FunctionPackage: cgToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 8.1
Unrevised from 8.0 to 8.1. Minimal update since 8.1 release.
8.0 version

mouse-moved

Arguments: object buttons cursor-position

This generic function is called when the user moves the mouse cursor within the interior (client) area of a window, dialog-item, or hotspot. An application may add methods to this generic function to respond to mouse events in these objects. The built-in methods should not be overridden, though, because they perform some standard internal tasks.

object is the window, dialog-item, or hotspot in which the event occurred.

buttons is an integer indicating which mouse buttons and shift keys were down when the event occurred. The value is the result of applying logior to the values of the following bit-flag variables:

Other bits might be turned on as well, so functions such as logtest should be used to determine whether a particular mouse button or shift key was down; for example,

(logtest left-mouse-button buttons) 

will return true if and only if the left mouse button was down. For "down" events, the value includes the button or key being pressed now; for "up" events, the value does not include the button or key being released.

cursor-position is a position object indicating the location of the mouse cursor when the event occurred. It is in "stream coordinates", which are relative to the origin of the possibly scrolled page (canvas) of the window; pixels are the unit of distance unless the window is a scaling-stream. (The origin of a stream is typically left at 0,0, which indicates the top-left corner of the scrollable page; see stream-origin.)

Note: the value of the cursor-position argument becomes invalid when mouse-moved returns, in order to avoid the inefficiency of consing position objects for frequent mouse-moved events. If an application needs to keep this argument around to reference it after mouse-moved has returned, it should call copy-position on the value and save the copy rather than the original value.

This cursor-position restriction 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 cg-events.htm for information about event handling in Common Graphics.


Copyright (c) 1998-2009, Franz Inc. Oakland, CA., USA. All rights reserved.
Documentation for Allegro CL version 8.1. This page was not revised from the 8.0 page.
Created 2009.9.22.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 8.1
Unrevised from 8.0 to 8.1. Minimal update since 8.1 release.
8.0 version