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.
 
  • 1 (left button)

 
  • 2 (right button)

 
  • 3 (middle button)

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.
 
  • To test if the Shift value (1) is set, use if shift.bitAnd(1) <> 0 then

 
  • To test if the Ctrl value (2) is set, use if shift.bitAnd(2) <> 0 then

 
  • To test if the Alt value (4) is set, use if shift.bitAnd(4) <> 0 then

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.

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.