Distributes events to event handlers. More...
Public Member Functions | |
object | getDeviceOrientation (boolean absolute=false) |
NOT IMPLEMENTED get the roll, pitch and yaw of the device More... | |
boolean | isButtonDown (int buttonNumber=0) |
check if button is down More... | |
boolean | isKeyDown (string unicodeChar) |
check if a key is down More... | |
boolean | isKeyDown (uint utf16CharCode) |
check if a key is down More... | |
boolean | isRawKeyDown (int keyCode) |
check if a key is down More... | |
Public Member Functions inherited from EventEmitter | |
addHandler (IEventHandler inHandler, int inEventType=all_events) | |
add a new handler for some event type, or for all events if no type specified. More... | |
blockEvent (int inEventType) | |
temporarily ignore all events of a particular type. More... | |
clear () | |
remove all handlers More... | |
removeHandler (IEventHandler inHandler, int inEventType=all_events) | |
remove a handler for some event type, or for all events (see note) if no type specified. More... | |
unblockEvent (int inEventType) | |
stop ignoring events of a particular type More... | |
Related Functions | |
(Note that these are not member functions.) | |
evt | |
the singleton instance of the EventManager More... | |
getEventManager | |
get the singleton instance of the EventManager used by the pdg framework More... | |
Distributes events to event handlers.
The EventManager is the core ofthe Pixel Dust Games Framework. All inputs to your game arrive as events via the Event Manager. This includes network messages and system level notifications in addition to user inputs such as keystrokes and mouse movements.
The EventManager expects the game developer to implement IEventHandler subclasses and register them to handle various events they are interested in.
getDeviceOrientation | ( | boolean | absolute = false | ) |
NOT IMPLEMENTED get the roll, pitch and yaw of the device
On mobile devices which allow the screen to be oriented different ways, this reports the current relative roll, pitch and yaw of the device. If absolute is if absolute is true, then yaw is compass direction from north around vertical axis, pitch is rotation around E -> W axis, and roll is rotation around N -> S axis
absolute | flag to indicate if roll, pitch and yaw are around compass directions (true) or relative (false) |
isButtonDown | ( | int | buttonNumber = 0 | ) |
check if button is down
Check the state of a particular mouse button or finger touch. For touch devices the number represents the order the fingers went down rather than specific physical buttons as on a mouse.
buttonNumber | the particular mouse button; defaults to zero, the left mouse button or first touch |
isKeyDown | ( | string | unicodeChar | ) |
check if a key is down
Check the state of a particular key as passed in a string. The string should be a single character that matches the value returned in KeyPressEvent.unicode for the desired key. If the string passed has multiple characters, only the first character will be used. This form of the call is typically used for printable characters.
unicodeChar | the character that is generated by the key to be checked |
isKeyDown | ( | uint | utf16CharCode | ) |
check if a key is down
Check the state of a particular key as passed as a UTF-16 character code value. This code matches the value returned in KeyPressEvent.unicode for the desired key. This is the form that would be used for non-printable codes such as key_UpArrow, key_Enter, etc...
utf16CharCode | the unicode value that is generated by the key to be checked |
isRawKeyDown | ( | int | keyCode | ) |
check if a key is down
Check the state of a particular key as passed as raw OS/hardware specific value. This code matches the value returned in KeyEvent.keyCode for the desired key. Since the keyCode values usually won't be known ahead of time, this is mainly useful when your app gives the user the ability to custom map keys to particular functions.
keyCode | the raw OS key code that is generated by the key to be checked |
|
related |
get the singleton instance of the EventManager used by the pdg framework