Package | cc.cote.jmulator.emulators |
Class | public class Emulator |
Inheritance | Emulator ![]() |
Subclasses | Ipac2, Ipac4, IpacVe |
Emulator
class is an abstract class which is used, and extended, by the
board-specific classes in the emulators
package. The Emulator
class
cannot be instantiated directly. Instead, use the board-specific class matching the device
you wish to use.
See also
Property | Defined By | ||
---|---|---|---|
boardEventClass : Class [read-only] The class of the currently-used emulator device. | Emulator | ||
capsLock : Boolean [read-only] Indicates if the capsLock key is currently engaged (true) or not (false). | Emulator | ||
jsonLabelMap : String [read-only]
A JSON representation of the board label to keyboard key mappings (useful for debugging). | Emulator | ||
listenOn : InteractiveObject [read-only] The object the emulator is listening on for key events. | Emulator | ||
map : Dictionary [read-only] A list of the mappings between key codes (as sent by the board) and event names. | Emulator | ||
numLock : Boolean [read-only] Indicates if the numLock key is currently engaged (true) or not (false). | Emulator | ||
supportedBoards : Vector.<Class> [read-only] List of emulator boards supported by this library. | Emulator | ||
triggering : String = both
The type of events that should be triggered by the Emulator object. | Emulator | ||
typematic : Boolean = false
A boolean specifying whether or not to ignore the OS typematic feature. | Emulator |
Method | Defined By | ||
---|---|---|---|
Emulator(listenOn:InteractiveObject, typematic:Boolean = false, triggering:String)
Constructor (private). | Emulator | ||
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void [override]
Registers an event listener object with an EventDispatcher object so that the listener
receives notification of an event. | Emulator | ||
dispose():void
Properly disposes of ressources used by the object, namely, the listeners. | Emulator | ||
isActive(input:String):Boolean
Returns the current status (activated or not) of a specific board input. | Emulator |
boardEventClass | property |
boardEventClass:Class
[read-only] The class of the currently-used emulator device.
public function get boardEventClass():Class
capsLock | property |
capsLock:Boolean
[read-only] Indicates if the capsLock key is currently engaged (true) or not (false).
public function get capsLock():Boolean
jsonLabelMap | property |
jsonLabelMap:String
[read-only] A JSON representation of the board label to keyboard key mappings (useful for debugging).
public function get jsonLabelMap():String
listenOn | property |
listenOn:InteractiveObject
[read-only] The object the emulator is listening on for key events. This is typically the stage.
public function get listenOn():InteractiveObject
map | property |
map:Dictionary
[read-only] A list of the mappings between key codes (as sent by the board) and event names.
public function get map():Dictionary
numLock | property |
numLock:Boolean
[read-only] Indicates if the numLock key is currently engaged (true) or not (false).
public function get numLock():Boolean
supportedBoards | property |
supportedBoards:Vector.<Class>
[read-only] List of emulator boards supported by this library.
public function get supportedBoards():Vector.<Class>
triggering | property |
public var triggering:String = both
The type of events that should be triggered by the Emulator
object. It can
be set to trigger events when inputs are activated only (EmulatorTriggerMode.TRIGGER_ON),
when they are deactivated only (EmulatorTriggerMode.TRIGGER_OFF) or on both activation
and deactivation (EmulatorTriggerModeTRIGGER_BOTH).
The default value is EmulatorTriggerMode.TRIGGER_BOTH
.
typematic | property |
public var typematic:Boolean = false
A boolean specifying whether or not to ignore the OS typematic feature. If typematic is enabled (it usually is), a stream of events will be triggered if the input stays activated for a while.
The default value is false
.
Emulator | () | Constructor |
public function Emulator(listenOn:InteractiveObject, typematic:Boolean = false, triggering:String)
Constructor (private). Cannot be instantiated directly. Use a board-specific class instead.
ParameterslistenOn:InteractiveObject — An InteractiveObject to attach the keyboard listener to. Usually
this is the Stage.
| |
typematic:Boolean (default = false ) — Whether or not to use the OS typematic feature. When the typematic
feature is enabled, the OS repeatedly sends keydown events when a
key is being held down.
| |
triggering:String (default = NaN ) — Triggering method : on button press only
(EmulatorTriggerMode.TRIGGER_ON), on button release only
(EmulatorTriggerMode.TRIGGER_OFF) or on both press and release
(EmulatorTriggerMode.TRIGGER_BOTH).
|
Error — The Emulator class cannot be instantiated directly. Use a subclass
from the emulators package.
|
addEventListener | () | method |
override public function addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener object with an EventDispatcher object so that the listener receives notification of an event.
Parameters
type:String — The type of event
| |
listener:Function — The listener function that processes the event. This function
must accept an Event object as its only parameter and must
return nothing.
| |
useCapture:Boolean (default = false ) — Determines whether the listener works in the capture phase or
the target and bubbling phases.
| |
priority:int (default = 0 ) — The priority level of the event listener. The priority is
designated by a signed 32-bit integer. The higher the number,
the higher the priority.
| |
useWeakReference:Boolean (default = false ) — Determines whether the reference to the listener is strong or
weak. A strong reference (the default) prevents your listener
from being garbage-collected.
|
ArgumentError — The requested input is disabled in the current configuration.
|
dispose | () | method |
public function dispose():void
Properly disposes of ressources used by the object, namely, the listeners.
isActive | () | method |
public function isActive(input:String):Boolean
Returns the current status (activated or not) of a specific board input.
Parameters
input:String — Board input label
|
Boolean — A boolean indicating if the input is in active mode (true) or inactive mode
(false).
|