AwtInputEvent

Methods
13
Fields
None

Methods

MethodReturnsDescription
consume()()Consumes the event: no listener after this one sees it, and the game does not either.
isConsumed()booleanWhether a listener consumed the event.
getModifiersEx()numberThe extended modifier mask: InputEvent.SHIFT_DOWN_MASK, CTRL_DOWN_MASK, ALT_DOWN_MASK, META_DOWN_MASK and the BUTTONn_DOWN_MASKs…
getModifiers()numberThe old-style modifier mask (InputEvent.SHIFT_MASK, ..., BUTTON1_MASK): for an event the client made, what AWT's constructor derives fr…
isShiftDown()booleanWhether Shift was down.
isControlDown()booleanWhether Control was down.
isAltDown()booleanWhether Alt was down.
isMetaDown()booleanWhether Meta was down. On Windows no key is Meta (AWT reports the Windows key as KeyEvent.VK_WINDOWS with no modifier), so this is `false…
isAltGraphDown()booleanWhether AltGraph was down. The client reports AltGr as Control and Alt, so this is always false.
getWhen()numberWhen the event happened, in milliseconds since the Unix epoch.
getID()numberThe event id: KeyEvent.KEY_PRESSED, MouseEvent.MOUSE_CLICKED, MouseEvent.MOUSE_WHEEL, ...
getSource()Component?The component the event is about, for an event a Swing listener is handed (a panel's mouse, wheel or key listener): the component the liste…
getComponent()Component?The component, as getSource().

Method details

consume

consume: (AwtInputEvent) -> ()

Consumes the event: no listener after this one sees it, and the game does not either.

getModifiersEx

getModifiersEx: (AwtInputEvent) -> number

The extended modifier mask: InputEvent.SHIFT_DOWN_MASK, CTRL_DOWN_MASK, ALT_DOWN_MASK, META_DOWN_MASK and the BUTTONn_DOWN_MASKs of the buttons held.

getModifiers

getModifiers: (AwtInputEvent) -> number

The old-style modifier mask (InputEvent.SHIFT_MASK, ..., BUTTON1_MASK): for an event the client made, what AWT's constructor derives from the extended one; for one made with AwtMouseEvent.create, what that constructor kept.

isMetaDown

isMetaDown: (AwtInputEvent) -> boolean

Whether Meta was down. On Windows no key is Meta (AWT reports the Windows key as KeyEvent.VK_WINDOWS with no modifier), so this is false for an event the client made.

isAltGraphDown

isAltGraphDown: (AwtInputEvent) -> boolean

Whether AltGraph was down. The client reports AltGr as Control and Alt, so this is always false.

getWhen

getWhen: (AwtInputEvent) -> number

When the event happened, in milliseconds since the Unix epoch.

getID

getID: (AwtInputEvent) -> number

The event id: KeyEvent.KEY_PRESSED, MouseEvent.MOUSE_CLICKED, MouseEvent.MOUSE_WHEEL, ...

getSource

getSource: (AwtInputEvent) -> Component?

The component the event is about, for an event a Swing listener is handed (a panel's mouse, wheel or key listener): the component the listener was added to, or, for an event passed on with dispatchEvent, the one it first went to. nil for an event of the game canvas (a keyManager or mouseManager listener's: the canvas has no object here), and for a kept event whose component was collected since.