mouseUp
mouseUp(button: Integer; (Form) shift: Integer; x: Real; y: Real); mouseUp(control: control-type input; (Control) button: Integer; shift: Integer; x: Real; y: Real);
The mouseUp event occurs when the user releases a mouse button.
The mouseUp event uses the parameters listed in the following table.
Parameter | Description |
---|---|
button | The button that was released to cause the event. |
|
|
|
|
|
|
shift | The state of the Shift, Ctrl, and Alt keys when the mouse button was released. This integer is a combination of values, as follows. |
|
|
|
|
|
|
x | The current left physical position of the mouse pointer in the window. This is in the units of the scaleMode property of the form or control. |
y | The current top physical position of the mouse pointer in the window. This is in the units of the scaleMode property of the form or control. |
For details about converting the horizontal (x) and vertical (y) physical pixel positions to logical positions within the window that has been scrolled, see the scrollHorzPos property.
Use a mouseUp event to specify actions to occur when a specified mouse button is released. Unlike the click or dblClick event, the mouseUp event enables you to distinguish between the left, right, and middle mouse buttons. (For details about the context menu event that occurs after the right mouseUp event, see the contextMenu event method.)
If a called window does not implement the contextMenu event, the default processing continues. Drag mode is terminated (that is, the dragDrop event is received) by any mouseUp event (that is, when the left, right, or middle mouse button is released).
You can also write logic for mouse and keyboard combinations that use the Shift, Ctrl, and ALT keyboard modifiers.
See the Window class for details of the MouseButton_ constants provided for window classes.
The following applies to both click and dblClick events.
-
If a mouse button is pressed while the cursor is over a form or control, that object "captures" the mouse and receives all mouse events up to and including the last mouseUp event. This implies that the x and y mouse-pointer coordinates specified by a mouse event may not always be in the client area of the object that receives them.
-
If mouse buttons are pressed in succession, the object that captures the mouse after the first press receives all mouse events until all buttons are released.
You can use a mouseMove event to respond to an event caused by moving the mouse or the mouseLeave event to respond to the user moving the mouse off the control. The button parameter for the mouseUp event differs from the button parameter used for the mouseMove event.
For the mouseUp event, the button parameter indicates exactly one button for each event; for the mouseMove event, it indicates the current state of all buttons.