A script-enabled browser is required for this page to function properly.

Performing Actions Based on the Mouse Button Pressed

You can initiate an action based on which button the operator presses, whether the button pressed is button 1, 2 or 3.

You can also initiate an action based on a single click, a double-click, a single click combined with a shift modifier, and other combinations.

Button Number Pressed
 
To initiate an action based on the mouse button pressed, use a When-Mouse-Click trigger in conjunction with the SYSTEM.MOUSE_BUTTON_PRESSED system variable.
 
Single or Double-click
 
To perform an action when the operator clicks or double-clicks the mouse, use either a When-Mouse-Click or a When-Mouse-DoubleClick trigger.

Performing actions based on the mouse button pressed Example

The following example demonstrates how to determine which mouse button is pressed when the operator clicks the mouse.

/* ** Trigger: When-Mouse-Click */

DECLARE 
the_button_pressed VARCHAR(1); 
BEGIN 
the_button_pressed := :System.Mouse_Button_Pressed; 
IF the_button_pressed = '1' THEN 
Show_Window('options_window'); 
END IF; 
END;
 


About mouse events, triggers, and system variables

When-Mouse-Click Trigger

SYSTEM.MOUSE_BUTTON_PRESSED examples

SYSTEM.MOUSE_BUTTON_SHIFT_STATE examples

When-Mouse-DoubleClick Trigger