com.jogamp.newt.event

## Class InputEvent

- java.lang.Object
- - java.util.EventObject
  - - com.jogamp.newt.event.NEWTEvent
    - - com.jogamp.newt.event.InputEvent

- All Implemented Interfaces:
    Serializable
  Direct Known Subclasses:
    GestureHandler.GestureEvent, KeyEvent, MouseEvent

      public abstract class InputEvent
      extends NEWTEvent

  See Also:
    Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `InputEvent.InputClass` Interface marking class of input types
    `static interface` | `InputEvent.InputType` Interface marking type of input devices

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `ALT_GRAPH_MASK`
    `static int` | `ALT_MASK`
    `static int` | `AUTOREPEAT_MASK` Event is caused by auto-repeat.
    `static int` | `BUTTON1_MASK`
    `static int` | `BUTTON2_MASK`
    `static int` | `BUTTON3_MASK`
    `static int` | `BUTTON4_MASK`
    `static int` | `BUTTON5_MASK`
    `static int` | `BUTTON6_MASK`
    `static int` | `BUTTON7_MASK`
    `static int` | `BUTTON8_MASK`
    `static int` | `BUTTON9_MASK`
    `static int` | `BUTTONALL_MASK`
    `static int` | `BUTTONLAST_MASK`
    `static int` | `CONFINED_MASK` Pointer is confined, see `Window.confinePointer(boolean)`.
    `static int` | `CTRL_MASK`
    `static int` | `INVISIBLE_MASK` Pointer is invisible, see `Window.setPointerVisible(boolean)`.
    `static int` | `META_MASK`
    `static int` | `SHIFT_MASK`

    - ### Fields inherited from class com.jogamp.newt.event.NEWTEvent

      `consumedTag`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getButtonDownCount()` Returns the number of pressed buttons by counting the set bits:
    `static int` | `getButtonMask(int button)` Returns the corresponding button mask for the given button.
    `short[]` | `getButtonsDown()` See also `MouseEvent`'s section about Multiple-Pointer Events.
    `int` | `getModifiers()` Return the modifier bits of this event, e.g.
    `StringBuilder` | `getModifiersString(StringBuilder sb)`
    `boolean` | `isAltDown()` `getModifiers()` contains `ALT_MASK`.
    `boolean` | `isAltGraphDown()` `getModifiers()` contains `ALT_GRAPH_MASK`.
    `boolean` | `isAnyButtonDown()` Returns true if at least one button is pressed, otherwise false:
    `boolean` | `isAutoRepeat()` `getModifiers()` contains `AUTOREPEAT_MASK`.
    `boolean` | `isButtonDown(int button)` See also `MouseEvent`'s section about Multiple-Pointer Events.
    `boolean` | `isConfined()` `getModifiers()` contains `CONFINED_MASK`.
    `boolean` | `isControlDown()` `getModifiers()` contains `CTRL_MASK`.
    `boolean` | `isInvisible()` `getModifiers()` contains `INVISIBLE_MASK`.
    `boolean` | `isMetaDown()` `getModifiers()` contains `META_MASK`.
    `boolean` | `isShiftDown()` `getModifiers()` contains `SHIFT_MASK`.
    `String` | `toString()`
    `StringBuilder` | `toString(StringBuilder sb)`

    - ### Methods inherited from class com.jogamp.newt.event.NEWTEvent

      `getAttachment, getEventType, getWhen, isConsumed, setAttachment, setConsumed, toHexString`

    - ### Methods inherited from class java.util.EventObject

      `getSource`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### SHIFT_MASK

          public static final int SHIFT_MASK

      See Also:
        Constant Field Values

    - #### CTRL_MASK

          public static final int CTRL_MASK

      See Also:
        Constant Field Values

    - #### META_MASK

          public static final int META_MASK

      See Also:
        Constant Field Values

    - #### ALT_MASK

          public static final int ALT_MASK

      See Also:
        Constant Field Values

    - #### ALT_GRAPH_MASK

          public static final int ALT_GRAPH_MASK

      See Also:
        Constant Field Values

    - #### BUTTON1_MASK

          public static final int BUTTON1_MASK

      See Also:
        Constant Field Values

    - #### BUTTON2_MASK

          public static final int BUTTON2_MASK

      See Also:
        Constant Field Values

    - #### BUTTON3_MASK

          public static final int BUTTON3_MASK

      See Also:
        Constant Field Values

    - #### BUTTON4_MASK

          public static final int BUTTON4_MASK

      See Also:
        Constant Field Values

    - #### BUTTON5_MASK

          public static final int BUTTON5_MASK

      See Also:
        Constant Field Values

    - #### BUTTON6_MASK

          public static final int BUTTON6_MASK

      See Also:
        Constant Field Values

    - #### BUTTON7_MASK

          public static final int BUTTON7_MASK

      See Also:
        Constant Field Values

    - #### BUTTON8_MASK

          public static final int BUTTON8_MASK

      See Also:
        Constant Field Values

    - #### BUTTON9_MASK

          public static final int BUTTON9_MASK

      See Also:
        Constant Field Values

    - #### BUTTONLAST_MASK

          public static final int BUTTONLAST_MASK

      See Also:
        Constant Field Values

    - #### BUTTONALL_MASK

          public static final int BUTTONALL_MASK

      See Also:
        Constant Field Values

    - #### AUTOREPEAT_MASK

          public static final int AUTOREPEAT_MASK

      Event is caused by auto-repeat.
      See Also:
        Constant Field Values

    - #### CONFINED_MASK

          public static final int CONFINED_MASK

      Pointer is confined, see `Window.confinePointer(boolean)`.
      See Also:
        Constant Field Values

    - #### INVISIBLE_MASK

          public static final int INVISIBLE_MASK

      Pointer is invisible, see `Window.setPointerVisible(boolean)`.
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### getButtonMask

          public static final int getButtonMask(int button)

      Returns the corresponding button mask for the given button.

      In case the given button lies outside of the valid range [`MouseEvent.BUTTON1` .. `MouseEvent.BUTTON_COUNT`], null is returned.

    - #### getModifiers

          public final int getModifiers()

      Return the modifier bits of this event, e.g. see `SHIFT_MASK` .. etc.

    - #### isAltDown

          public final boolean isAltDown()

      `getModifiers()` contains `ALT_MASK`.

    - #### isAltGraphDown

          public final boolean isAltGraphDown()

      `getModifiers()` contains `ALT_GRAPH_MASK`.

    - #### isControlDown

          public final boolean isControlDown()

      `getModifiers()` contains `CTRL_MASK`.

    - #### isMetaDown

          public final boolean isMetaDown()

      `getModifiers()` contains `META_MASK`.

    - #### isShiftDown

          public final boolean isShiftDown()

      `getModifiers()` contains `SHIFT_MASK`.

    - #### isAutoRepeat

          public final boolean isAutoRepeat()

      `getModifiers()` contains `AUTOREPEAT_MASK`.

    - #### isConfined

          public final boolean isConfined()

      `getModifiers()` contains `CONFINED_MASK`. Pointer is confined, see `Window.confinePointer(boolean)`.

    - #### isInvisible

          public final boolean isInvisible()

      `getModifiers()` contains `INVISIBLE_MASK`. Pointer is invisible, see `Window.setPointerVisible(boolean)`.

    - #### getModifiersString

          public final StringBuilder getModifiersString(StringBuilder sb)

    - #### getButtonsDown

          public final short[] getButtonsDown()

      See also `MouseEvent`'s section about Multiple-Pointer Events.
      Returns:
        Array of pressed mouse buttons [`MouseEvent.BUTTON1` .. `MouseEvent.BUTTON6`]. If none is down, the resulting array is of length 0.

    - #### isButtonDown

          public final boolean isButtonDown(int button)

      See also `MouseEvent`'s section about Multiple-Pointer Events.
      Parameters:
        `button` - the button to test
      Returns:
        true if the given button is down

    - #### getButtonDownCount

          public final int getButtonDownCount()

      Returns the number of pressed buttons by counting the set bits:

               getBitCount(modifiers & BUTTONALL_MASK);

      See also `MouseEvent`'s section about Multiple-Pointer Events.

      See Also:
        `IntBitfield.getBitCount(int)`, `BUTTONALL_MASK`

    - #### isAnyButtonDown

          public final boolean isAnyButtonDown()

      Returns true if at least one button is pressed, otherwise false:

               0 != ( modifiers & BUTTONALL_MASK )

      See also `MouseEvent`'s section about Multiple-Pointer Events.

      See Also:
        `IntBitfield.getBitCount(int)`, `BUTTONALL_MASK`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `NEWTEvent`

    - #### toString

          public StringBuilder toString(StringBuilder sb)

      Overrides:
        `toString` in class `NEWTEvent`

Copyright 2010 JogAmp Community.