MouseDown, MouseUp
These two events give you access to each of the components of a click. MouseDown fires when the user presses a mouse button, and MouseUp fires when the user releases the button. These even respond to up to three different mouse buttons and can tell you whether you're pressing any of the modifier keys (Shift, Ctrl, Alt) at the same time.
Usage |
PROCEDURE oObject.MouseDown | oObject.MouseUp LPARAMETERS [ nIndex , ] nButton, nKeys, nXCoord, nYCoord |
Parameter |
Value |
Meaning |
nIndex |
Numeric |
The member of a control array that fired the event. |
Omitted |
The control is not in a control array. |
|
nButton |
1 |
Left button |
2 |
Right button |
|
4 |
Center button |
|
nKeys |
0 |
No modifiers pressed |
1 |
Shift key pressed |
|
2 |
Ctrl key pressed |
|
3 |
Shift and Ctrl keys pressed |
|
4 |
Alt key pressed |
|
5 |
Shift and Alt keys pressed |
|
6 |
Ctrl and Alt keys pressed |
|
7 |
Shift, Ctrl and Alt keys pressed |
|
nXCoord, nYCoord |
Numeric |
The coordinates of the mouse location in the form's ScaleMode. |
FoxPro uses the Ctrl+Alt+Shift combination to let you hide a bunch of windows to see what's behind them. We love this capability and use it all the time. However, it interferes with mouse events. When you press all three keys and then push a mouse button, none of the mouse events fire. If it's important to be able to Ctrl+Alt+Shift+Click, add the line OUTSHOW=OFF to your Config.FPW file. |
Example |
* MouseDown is a good place to initiate drag-and-drop. This.Drag(1) |
See Also |
AMouseObj(), Click, DblClick, Drag, DragDrop, MiddleClick, MouseMove, RightClick |