Generic Function | Package: cg | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 9.0 Unrevised from 8.2 to 9.0. 8.2 version

## nc-mouse-moved

Arguments: window buttons cursor-position frame-section

This generic function is called whenever the user moves the mouse cursor within the frame (border) area of a window. An application may add methods to this generic function to respond to mouse events in its windows, though frame-area events are usually left to the operating system.

window is the window 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:

- `left-mouse-button`
- `middle-mouse-button`
- `right-mouse-button`
- `first-x-button` (see `*ignore-mouse-x-buttons*`)
- `second-x-button` (see `*ignore-mouse-x-buttons*`),
- `shift-key`
- `control-key`
- `alt-key`

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 pixel coordinates relative to the upper-left corner of the screen.

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

This cursor-position constraint also applies to the deprecated generic function nc-event when the message argument is the value of the constant nc-mouse-moved; in this case the data argument is the position which will become invalid when the nc-event method returns.

frame-section is a keyword indicating the general area of the frame in which the event occurred. The value will be one of the following symbols:

- `:left`
- `:top-left`
- `:top`
- `:top-right`
- `:right`
- `:bottom-right`
- `:bottom`
- `:bottom-left`
- `:caption`
- `:client`
- `:error`
- `:nowhere`
- `:grow-box`
- `:horizontal-scrollbar`
- `:vertical-scrollbar`
- `:menu`
- `:system-menu`
- `:minimize`
- `:maximize`
- `:transparent`
- `:object`
- `:close`
- `:help`

Thus, `:top-left`, for example, denotes the area at the upper left where the window's left and top edges can be stretched, while `:maximize` refers to the gadget that maximizes the window.

See cg-events.htm for information about event handling in Common Graphics.

Copyright (c) 1998-2019, Franz Inc. Oakland, CA., USA. All rights reserved.
This page was not revised from the 8.2 page.
Created 2012.5.30.

|  | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 9.0 Unrevised from 8.2 to 9.0. 8.2 version