## WorkShop Visual Replay Command Syntax - Button Actions (Simple controls)

#### Keywords

- push - press and release a mouse button
- doubleclick - doubleclick mouse button

#### Synopsis

        push widget [with [modifier-]button[1-5]]
        doubleclick widget

#### Inputs

- widget - the name of a widget
- modifier - a keyboard modifier
- button[1-5] - the number of the mouse button (default is button 1 with no modifiers).

#### Description

push simulates a single click (a mouse button press/release sequence) using a mouse button on the named widget. The with keyword allows you to specify a particular mouse button. If this is not used, button1 (the left mouse button) is used. A keyboard modifier (such as the Shift key) can be used to extend the permutations of mouse button events. The permitted modifiers are alt, ctrl and shift.

doubleclick simulates a doubleclick with the left mouse button. This can be used in any widget but is especially useful for selecting from a text widget. (See Text Entry).

#### Usage

In some widgets, where the user clicks with the mouse is unimportant. For example, clicking on a button widget in any part of it will activate that button. However, for other widgets, the position is significant; for example pushing on a scale widget will have different effects depending upon the where the push was made.

Position dependent widgets are:

- Sliders
- Scales
- Lists
- Drawing Areas
- Text Widgets
- Non-Motif widgets

Non-position dependent widgets are:

- Buttons
- Toggles

Recording and replaying user interaction with text widgets is covered in Text Entry.

See Button Actions (Position Dependent Controls) for details on recording and replaying position dependent widgets.

#### Examples

        in ApplicationShell
    	push this_button

        in ApplicationShell
    	push that_button with shift-button2

        in my_dialog_popup
    	if color_toggle->set:true
    	    push color_toggle
    	endif

See also:

- WorkShop Visual Replay Command Syntax