JOGL v2.6.0-rc-20250712
JOGL, High-Performance Graphics Binding for Java™ (public API).
com.jogamp.newt.event.InputEvent Class Referenceabstract
Inheritance diagram for com.jogamp.newt.event.InputEvent:
Collaboration diagram for com.jogamp.newt.event.InputEvent:

Classes

interface  InputClass
 Interface marking class of input types. More...
 
interface  InputType
 Interface marking type of input devices. More...
 

Public Member Functions

final int getModifiers ()
 Return the modifier bits of this event, e.g. More...
 
final boolean isAltDown ()
 getModifiers() contains ALT_MASK. More...
 
final boolean isAltGraphDown ()
 getModifiers() contains ALT_GRAPH_MASK. More...
 
final boolean isControlDown ()
 getModifiers() contains CTRL_MASK. More...
 
final boolean isMetaDown ()
 getModifiers() contains META_MASK. More...
 
final boolean isShiftDown ()
 getModifiers() contains SHIFT_MASK. More...
 
final boolean isAutoRepeat ()
 getModifiers() contains AUTOREPEAT_MASK. More...
 
final boolean isConfined ()
 getModifiers() contains CONFINED_MASK. More...
 
final boolean isInvisible ()
 getModifiers() contains INVISIBLE_MASK. More...
 
final StringBuilder getModifiersString (StringBuilder sb)
 
final short[] getButtonsDown ()
 See also MouseEvent's section about Multiple-Pointer Events. More...
 
final boolean isButtonDown (final int button)
 See also MouseEvent's section about Multiple-Pointer Events. More...
 
final int getButtonDownCount ()
 Returns the number of pressed buttons by counting the set bits: More...
 
final boolean isAnyButtonDown ()
 Returns true if at least one button is pressed, otherwise false: More...
 
String toString ()
 
StringBuilder toString (StringBuilder sb)
 
- Public Member Functions inherited from com.jogamp.newt.event.NEWTEvent
final short getEventType ()
 Returns the event type of this event. More...
 
final long getWhen ()
 Returns the timestamp, in milliseconds, of this event. More...
 
final void setAttachment (final Object attachment)
 Attach the passed object to this event. More...
 
final Object getAttachment ()
 
final boolean isConsumed ()
 Returns true if this events has been consumed, otherwise false. More...
 
final void setConsumed (final boolean consumed)
 If consumed is true, this event is marked as consumed, ie. More...
 
String toString ()
 
StringBuilder toString (StringBuilder sb)
 

Static Public Member Functions

static final int getButtonMask (final int button)
 Returns the corresponding button mask for the given button. More...
 
- Static Public Member Functions inherited from com.jogamp.newt.event.NEWTEvent
static String toHexString (final short hex)
 

Static Public Attributes

static final int SHIFT_MASK = 1 << 0
 
static final int CTRL_MASK = 1 << 1
 
static final int META_MASK = 1 << 2
 
static final int ALT_MASK = 1 << 3
 
static final int ALT_GRAPH_MASK = 1 << 4
 
static final int BUTTON1_MASK = 1 << 5
 
static final int BUTTON2_MASK = 1 << 6
 
static final int BUTTON3_MASK = 1 << 7
 
static final int BUTTON4_MASK = 1 << 8
 
static final int BUTTON5_MASK = 1 << 9
 
static final int BUTTON6_MASK = 1 << 10
 
static final int BUTTON7_MASK = 1 << 11
 
static final int BUTTON8_MASK = 1 << 12
 
static final int BUTTON9_MASK = 1 << 13
 
static final int BUTTONLAST_MASK = 1 << 20
 
static final int BUTTONALL_MASK = 0xffff << 5
 
static final int AUTOREPEAT_MASK = 1 << 29
 Event is caused by auto-repeat. More...
 
static final int CONFINED_MASK = 1 << 30
 Pointer is confined, see Window#confinePointer(boolean). More...
 
static final int INVISIBLE_MASK = 1 << 31
 Pointer is invisible, see Window#setPointerVisible(boolean). More...
 
- Static Public Attributes inherited from com.jogamp.newt.event.NEWTEvent
static final Object consumedTag = new Object()
 See setConsumed(boolean) for description. More...
 

Protected Member Functions

 InputEvent (final short eventType, final Object source, final long when, final int modifiers)
 
- Protected Member Functions inherited from com.jogamp.newt.event.NEWTEvent
 NEWTEvent (final short eventType, final Object source, final long when)
 

Detailed Description

Definition at line 41 of file InputEvent.java.

Constructor & Destructor Documentation

◆ InputEvent()

com.jogamp.newt.event.InputEvent.InputEvent ( final short  eventType,
final Object  source,
final long  when,
final int  modifiers 
)
protected

Definition at line 94 of file InputEvent.java.

Member Function Documentation

◆ getButtonDownCount()

final int com.jogamp.newt.event.InputEvent.getButtonDownCount ( )

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

    getBitCount(modifiers & BUTTONALL_MASK);

<p<blockquote>‍

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

See also
Bitfield.Util::bitCount(int)
BUTTONALL_MASK

Definition at line 194 of file InputEvent.java.

◆ getButtonMask()

static final int com.jogamp.newt.event.InputEvent.getButtonMask ( final int  button)
static

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.

Definition at line 87 of file InputEvent.java.

◆ getButtonsDown()

final short[] com.jogamp.newt.event.InputEvent.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.

Definition at line 163 of file InputEvent.java.

◆ getModifiers()

final int com.jogamp.newt.event.InputEvent.getModifiers ( )

Return the modifier bits of this event, e.g.

see SHIFT_MASK .. etc.

Definition at line 100 of file InputEvent.java.

Here is the caller graph for this function:

◆ getModifiersString()

final StringBuilder com.jogamp.newt.event.InputEvent.getModifiersString ( StringBuilder  sb)

Definition at line 136 of file InputEvent.java.

◆ isAltDown()

final boolean com.jogamp.newt.event.InputEvent.isAltDown ( )

getModifiers() contains ALT_MASK.

Definition at line 104 of file InputEvent.java.

Here is the caller graph for this function:

◆ isAltGraphDown()

final boolean com.jogamp.newt.event.InputEvent.isAltGraphDown ( )

getModifiers() contains ALT_GRAPH_MASK.

Definition at line 108 of file InputEvent.java.

◆ isAnyButtonDown()

final boolean com.jogamp.newt.event.InputEvent.isAnyButtonDown ( )

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

    0 != ( modifiers & BUTTONALL_MASK )

<p<blockquote>‍

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

See also
Bitfield.Util::bitCount(int)
BUTTONALL_MASK

Definition at line 209 of file InputEvent.java.

◆ isAutoRepeat()

final boolean com.jogamp.newt.event.InputEvent.isAutoRepeat ( )

getModifiers() contains AUTOREPEAT_MASK.

Definition at line 124 of file InputEvent.java.

Here is the caller graph for this function:

◆ isButtonDown()

final boolean com.jogamp.newt.event.InputEvent.isButtonDown ( final int  button)

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

Parameters
buttonthe button to test
Returns
true if the given button is down

Definition at line 179 of file InputEvent.java.

◆ isConfined()

final boolean com.jogamp.newt.event.InputEvent.isConfined ( )

getModifiers() contains CONFINED_MASK.

Pointer is confined, see Window#confinePointer(boolean).

Definition at line 128 of file InputEvent.java.

Here is the caller graph for this function:

◆ isControlDown()

final boolean com.jogamp.newt.event.InputEvent.isControlDown ( )

getModifiers() contains CTRL_MASK.

Definition at line 112 of file InputEvent.java.

Here is the caller graph for this function:

◆ isInvisible()

final boolean com.jogamp.newt.event.InputEvent.isInvisible ( )

getModifiers() contains INVISIBLE_MASK.

Pointer is invisible, see Window#setPointerVisible(boolean).

Definition at line 132 of file InputEvent.java.

◆ isMetaDown()

final boolean com.jogamp.newt.event.InputEvent.isMetaDown ( )

getModifiers() contains META_MASK.

Definition at line 116 of file InputEvent.java.

◆ isShiftDown()

final boolean com.jogamp.newt.event.InputEvent.isShiftDown ( )

getModifiers() contains SHIFT_MASK.

Definition at line 120 of file InputEvent.java.

Here is the caller graph for this function:

◆ toString() [1/2]

◆ toString() [2/2]

StringBuilder com.jogamp.newt.event.InputEvent.toString ( StringBuilder  sb)

Reimplemented from com.jogamp.newt.event.NEWTEvent.

Reimplemented in com.jogamp.newt.event.KeyEvent, and com.jogamp.newt.event.MouseEvent.

Definition at line 219 of file InputEvent.java.

Member Data Documentation

◆ ALT_GRAPH_MASK

final int com.jogamp.newt.event.InputEvent.ALT_GRAPH_MASK = 1 << 4
static

Definition at line 55 of file InputEvent.java.

◆ ALT_MASK

final int com.jogamp.newt.event.InputEvent.ALT_MASK = 1 << 3
static

Definition at line 54 of file InputEvent.java.

◆ AUTOREPEAT_MASK

final int com.jogamp.newt.event.InputEvent.AUTOREPEAT_MASK = 1 << 29
static

Event is caused by auto-repeat.

Definition at line 71 of file InputEvent.java.

◆ BUTTON1_MASK

final int com.jogamp.newt.event.InputEvent.BUTTON1_MASK = 1 << 5
static

Definition at line 57 of file InputEvent.java.

◆ BUTTON2_MASK

final int com.jogamp.newt.event.InputEvent.BUTTON2_MASK = 1 << 6
static

Definition at line 58 of file InputEvent.java.

◆ BUTTON3_MASK

final int com.jogamp.newt.event.InputEvent.BUTTON3_MASK = 1 << 7
static

Definition at line 59 of file InputEvent.java.

◆ BUTTON4_MASK

final int com.jogamp.newt.event.InputEvent.BUTTON4_MASK = 1 << 8
static

Definition at line 60 of file InputEvent.java.

◆ BUTTON5_MASK

final int com.jogamp.newt.event.InputEvent.BUTTON5_MASK = 1 << 9
static

Definition at line 61 of file InputEvent.java.

◆ BUTTON6_MASK

final int com.jogamp.newt.event.InputEvent.BUTTON6_MASK = 1 << 10
static

Definition at line 62 of file InputEvent.java.

◆ BUTTON7_MASK

final int com.jogamp.newt.event.InputEvent.BUTTON7_MASK = 1 << 11
static

Definition at line 63 of file InputEvent.java.

◆ BUTTON8_MASK

final int com.jogamp.newt.event.InputEvent.BUTTON8_MASK = 1 << 12
static

Definition at line 64 of file InputEvent.java.

◆ BUTTON9_MASK

final int com.jogamp.newt.event.InputEvent.BUTTON9_MASK = 1 << 13
static

Definition at line 65 of file InputEvent.java.

◆ BUTTONALL_MASK

final int com.jogamp.newt.event.InputEvent.BUTTONALL_MASK = 0xffff << 5
static

Definition at line 68 of file InputEvent.java.

◆ BUTTONLAST_MASK

final int com.jogamp.newt.event.InputEvent.BUTTONLAST_MASK = 1 << 20
static

Definition at line 67 of file InputEvent.java.

◆ CONFINED_MASK

final int com.jogamp.newt.event.InputEvent.CONFINED_MASK = 1 << 30
static

Pointer is confined, see Window#confinePointer(boolean).

Definition at line 74 of file InputEvent.java.

◆ CTRL_MASK

final int com.jogamp.newt.event.InputEvent.CTRL_MASK = 1 << 1
static

Definition at line 52 of file InputEvent.java.

◆ INVISIBLE_MASK

final int com.jogamp.newt.event.InputEvent.INVISIBLE_MASK = 1 << 31
static

Pointer is invisible, see Window#setPointerVisible(boolean).

Definition at line 77 of file InputEvent.java.

◆ META_MASK

final int com.jogamp.newt.event.InputEvent.META_MASK = 1 << 2
static

Definition at line 53 of file InputEvent.java.

◆ SHIFT_MASK

final int com.jogamp.newt.event.InputEvent.SHIFT_MASK = 1 << 0
static

Definition at line 51 of file InputEvent.java.


The documentation for this class was generated from the following file: