public final class

KeyEvent

extends Object
implements Keys
java.lang.Object
   ↳ com.neomades.app.KeyEvent

Class Overview

Key event generated by a end-used action. Contains Key codes constants.

Summary

[Expand]
Inherited Constants
From interface com.neomades.app.Keys
Public Methods
int getKeyCode()
Returns the key code.
int getNumber()
Returns the number corresponding to the key.
int getRepeatCount()
Returns the number of repeated events.
boolean isBack()
If the key action is corresponding to the BACK action.
boolean isDown()
If the key action is corresponding to the DOWN action.
boolean isFire()
If the key action is corresponding to the FIRE action.
boolean isLeft()
If the key action is corresponding to the LEFT action.
boolean isMenu()
If the key action is corresponding to the MENU action.
boolean isNum()
If the key action is corresponding to a numeric key
boolean isPressed()
If the key is currently pressed.
boolean isReleased()
If the key has been released.
boolean isRepeated()
If the key has been repeated.
boolean isRight()
If the key action is corresponding to the RIGHT action.
boolean isUp()
If the key action is corresponding to the UP action.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public int getKeyCode ()

Returns the key code. It could be compared with constants

Returns
  • the key code.

public int getNumber ()

Returns the number corresponding to the key.

Returns
  • the corresponding number, or -1 if the key is not a number

public int getRepeatCount ()

Returns the number of repeated events.

Returns
  • the repeat count

public boolean isBack ()

If the key action is corresponding to the BACK action.

Returns
  • if the key is the BACK action

public boolean isDown ()

If the key action is corresponding to the DOWN action.

Returns
  • if the key is the DOWN action

public boolean isFire ()

If the key action is corresponding to the FIRE action.

Returns
  • if the key is the FIRE action

public boolean isLeft ()

If the key action is corresponding to the LEFT action.

Returns
  • if the key is the LEFT action

public boolean isMenu ()

If the key action is corresponding to the MENU action.

Returns
  • if the key is the MENU action

public boolean isNum ()

If the key action is corresponding to a numeric key

Returns
  • if the key is a numeric key

public boolean isPressed ()

If the key is currently pressed.

Returns
  • the key is pressed.

public boolean isReleased ()

If the key has been released.

Returns
  • the key has been released.

public boolean isRepeated ()

If the key has been repeated. Repeat does not mean that the user has pressed many times on the key, but the user keep the key pressed a long time.

Returns
  • if the key pressed for a long time

public boolean isRight ()

If the key action is corresponding to the RIGHT action.

Returns
  • if the key is the RIGHT action

public boolean isUp ()

If the key action is corresponding to the UP action.

Returns
  • if the key is the UP action