en:clickb [BASIC 256 - Language Documentation]

# BASIC 256 - Language Documentation

en:clickb

## Clickb (Function)

### Format

clickb
clickb ( )

returns positive_integer_value

### Description

Returns the buttons that the user last clicked on the mouse (if over the graphic output). Returns 0 if no click has been recorded. If multiple buttons have been pressed the value is the sum of the values for all pressed buttons.

Return Values
Value | Mouse Button Pressed
--- | ---
0 | None
1 | Left
2 | Right
4 | Center

### Example

    # clear any prior mouse click
    clickclear
    # wait for the user to click the mouse
    print "click mouse on the graphics output"
    while clickb = 0
      pause .01
    endwhile
    # show where the user clicked
    print "The user clicked at (" + clickx + "," + clicky + ")"

### See Also

Clickb, Clickclear, Clickx, Clicky, Mouseb, Mousex, Mousey,

### New To Version

0.9.4d

en/clickb.txt · Last modified: 2014/02/09 20:37 by admin