public class Event
extends java.lang.Object
EventGenerator
classes with event constants and helper methods to build and analyse events.
An event has a type, a 8-bit figure that forms the most significant byte of the int-event, followed by 8-bits which
is the generator id quantity, and followed by 16-bit of data.
event : type (8-bit) + generatorID (8-bit) + data (16-bit)
The very first 16 types [0x00..0x0f], some of which are defined by constants in this class, are MicroUI reserved. An application may create as many as 240 different kind of events.
EventGenerator
Modifier and Type | Field and Description |
---|---|
static int |
BUTTON
The BUTTON event type.
|
static int |
COMMAND
The COMMAND event type.
|
static int |
KEYBOARD
The KEYBOARD event type.
|
static int |
KEYPAD
The KEYPAD event type.
|
static int |
POINTER
The POINTER event type.
|
static int |
STATE
The STATE event type.
|
Modifier and Type | Method and Description |
---|---|
static int |
buildEvent(int type,
EventGenerator gen,
int data)
Builds an event from a given type, an eventGenerator and data.
|
static int |
getData(int event)
Returns the event's data issued by a generator.
|
static EventGenerator |
getGenerator(int event)
Gets a converter out of an event assuming the event has been generated by an
EventGenerator that has been
previously added to the system pool. |
static int |
getGeneratorID(int event)
Returns the event's generator id.
|
static int |
getType(int event)
Returns the type of an event.
|
public static final int COMMAND
public static final int BUTTON
public static final int KEYBOARD
public static final int POINTER
public static final int KEYPAD
public static final int STATE
public static int buildEvent(int type, EventGenerator gen, int data)
type
- the type of the event to buildgen
- the generator associated with the eventdata
- the data of the event to buildint
public static int getType(int event)
event
- an eventint
public static int getData(int event)
event
- an eventint
public static int getGeneratorID(int event)
event
- an eventint
public static EventGenerator getGenerator(int event)
EventGenerator
that has been
previously added to the system pool.event
- an eventEventGenerator
java.lang.NullPointerException
- if the generator does not exist (most likely because the event is not an EventGenerator related
event).EventGenerator.addToSystemPool()