button property

num get button

Gets or sets the numerical value representing the mouse button that caused this event.

Only one mouse button can cause an event at a time, but the set of all buttons currently pressed is kept in #buttons.

This property describes nothing during a mousemove event, since no button press causes the event. Instead, use the convenience properties #left, #middle, or #right, or use the value of #buttons to determine which mouse buttons are held during mousemove events.

Common values for this property:

  • 0: left mouse button
  • 1: middle mouse button
  • 2: right mouse button

Other values are possible if the mouse has additional buttons.

If there is no associated #event, setting this also sets the #buttons flags to only this button.

This property is valid if this is a mouse event.

Implementation

_i2.num get button => _i4.getProperty(
      this,
      'button',
    );
set button (num value)

Implementation

set button(_i2.num value) {
  _i4.setProperty(
    this,
    'button',
    value,
  );
}