Packagecc.cote.jmulator.emulators
Classpublic class Ipac2
InheritanceIpac2 Inheritance Emulator Inheritance flash.events.EventDispatcher

The Ipac2 class defines the characteristics of the I-PAC 2 board made by Ultimarc. It extends the base Emulator class and provides various functionalities to simplify working with this keyboard emulators. Namely, you will be freed from researching keyboard codes. You will be able to simply listen to events bearing the same names as the labels on the board you use. The class also offers additional functionalities such as selective typematic management and the choice between receiving all events, only ON events or only OFF events.

Using this class is straightforward. You create an IpacVe object and then add listeners to it for the inputs you are interested in. Here is a simple example to get you started :

     
     import cc.cote.jmulator.emulators.Ipac2;
     import cc.cote.jmulator.events.Ipac2Event;
     
     var emu:Ipac2 = new Ipac2(stage);
     emu.addEventListener(Ipac2Event.INPUT_2COIN, test);
     
     function test(e:Ipac2Event):void {
         trace(e);
     }
     

Please note that this class will only work with encoders using the default (MAME) settings and not with custom programs.

Limitations

Flash Player is currently unable to detect a KEY_DOWN or KEY_UP event for the ALT key. This means that the input labeled "1SW2" (which uses the ALT key in the default MAME configuration) does not work in Flash Player. In Adobe AIR, the "1SW2" input works fine.

Also note that the 1SW4 input - which is assigned to the SHIFT key - will never be in typematic mode. This is the behaviour of the SHIFT key on most modern operating systems and has nothing to do with your board, Flash or this library.

See also

http://www.ultimarc.com
cc.cote.jmulator.emulators.Emulator
cc.cote.jmulator.events.Ipac2Event


Public Properties
 PropertyDefined By
 InheritedboardEventClass : Class
[read-only] The class of the currently-used emulator device.
Emulator
 InheritedcapsLock : Boolean
[read-only] Indicates if the capsLock key is currently engaged (true) or not (false).
Emulator
 InheritedjsonLabelMap : String
[read-only] A JSON representation of the board label to keyboard key mappings (useful for debugging).
Emulator
 InheritedlistenOn : InteractiveObject
[read-only] The object the emulator is listening on for key events.
Emulator
 Inheritedmap : Dictionary
[read-only] A list of the mappings between key codes (as sent by the board) and event names.
Emulator
 InheritednumLock : Boolean
[read-only] Indicates if the numLock key is currently engaged (true) or not (false).
Emulator
 InheritedsupportedBoards : Vector.<Class>
[read-only] List of emulator boards supported by this library.
Emulator
 Inheritedtriggering : String = both
The type of events that should be triggered by the Emulator object.
Emulator
 Inheritedtypematic : Boolean = false
A boolean specifying whether or not to ignore the OS typematic feature.
Emulator
Public Methods
 MethodDefined By
  
Ipac2(listenOn:InteractiveObject, typematic:Boolean = false, triggering:String)
Creates an Ipac2 object extending the base Emulator object.
Ipac2
 Inherited
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
 Inherited
dispose():void
Properly disposes of ressources used by the object, namely, the listeners.
Emulator
 Inherited
isActive(input:String):Boolean
Returns the current status (activated or not) of a specific board input.
Emulator
Events
 Event Summary Defined By
  Dispatched when any of the board's input changes.Ipac2
  Dispatched when there is a change on the board input labeled "1A"Ipac2
  Dispatched when there is a change on the board input labeled "1B"Ipac2
  Dispatched when there is a change on the board input labeled "1COIN"Ipac2
  Dispatched when there is a change on the board input labeled "1DOWN"Ipac2
  Dispatched when there is a change on the board input labeled "1LEFT"Ipac2
  Dispatched when there is a change on the board input labeled "1RGHT"Ipac2
  Dispatched when there is a change on the board input labeled "1STRT"Ipac2
  Dispatched when there is a change on the board input labeled "1SW1"Ipac2
  Dispatched when there is a change on the board input labeled "1SW2"Ipac2
  Dispatched when there is a change on the board input labeled "1SW3"Ipac2
  Dispatched when there is a change on the board input labeled "1SW4"Ipac2
  Dispatched when there is a change on the board input labeled "1SW5"Ipac2
  Dispatched when there is a change on the board input labeled "1SW6"Ipac2
  Dispatched when there is a change on the board input labeled "1SW7"Ipac2
  Dispatched when there is a change on the board input labeled "1SW8"Ipac2
  Dispatched when there is a change on the board input labeled "1UP"Ipac2
  Dispatched when there is a change on the board input labeled "2A"Ipac2
  Dispatched when there is a change on the board input labeled "2B"Ipac2
  Dispatched when there is a change on the board input labeled "2COIN"Ipac2
  Dispatched when there is a change on the board input labeled "2DOWN"Ipac2
  Dispatched when there is a change on the board input labeled "2LEFT"Ipac2
  Dispatched when there is a change on the board input labeled "2RGHT"Ipac2
  Dispatched when there is a change on the board input labeled "2STRT"Ipac2
  Dispatched when there is a change on the board input labeled "2SW1"Ipac2
  Dispatched when there is a change on the board input labeled "2SW2"Ipac2
  Dispatched when there is a change on the board input labeled "2SW3"Ipac2
  Dispatched when there is a change on the board input labeled "2SW4"Ipac2
  Dispatched when there is a change on the board input labeled "2SW5"Ipac2
  Dispatched when there is a change on the board input labeled "2SW6"Ipac2
  Dispatched when there is a change on the board input labeled "2SW7"Ipac2
  Dispatched when there is a change on the board input labeled "2SW8"Ipac2
  Dispatched when there is a change on the board input labeled "2UP"Ipac2
Constructor Detail
Ipac2()Constructor
public function Ipac2(listenOn:InteractiveObject, typematic:Boolean = false, triggering:String)

Creates an Ipac2 object extending the base Emulator object. On top of inherited properties, this object defines the board-specific mappings between the label and key codes generated.

Parameters
listenOn:InteractiveObject — An InteractiveObject to attach the keyboard listener to. Usually this is the Stage.
 
typematic:Boolean (default = false) — Whether or not to let the OS' typematic feature send multiple events.
 
triggering:String (default = NaN) — The method to use to trigger events. Can be one of EmulatorTriggerMode.TRIGGER_ON, EmulatorTriggerMode.TRIGGER_OFF or EmulatorTriggerMode.TRIGGER_BOTH (default). TRIGGER_ON means to dispatch the events only when the input is activated, TRIGGER_OFF means to dispatch the events only when the input is deactivated and TRIGGER_BOTH means to trigger events when the input is activated and deactivated.

See also

Event Detail
anyInput Event
Event Object Type: cc.cote.jmulator.events.Ipac2Event
Ipac2Event.type property = cc.cote.jmulator.events.Ipac2Event.ANY_INPUT

Dispatched when any of the board's input changes.

The ANY_INPUT constant defines the value of the type property of a anyInput event object.
input_1a Event  
Event Object Type: cc.cote.jmulator.events.Ipac2Event
Ipac2Event.type property = cc.cote.jmulator.events.Ipac2Event.INPUT_1A

Dispatched when there is a change on the board input labeled "1A"

The INPUT_1A constant defines the value of the type property of a input_1a event object.
input_1b Event  
Event Object Type: cc.cote.jmulator.events.Ipac2Event
Ipac2Event.type property = cc.cote.jmulator.events.Ipac2Event.INPUT_1B

Dispatched when there is a change on the board input labeled "1B"

The INPUT_1B constant defines the value of the type property of a input_1b event object.
input_1coin Event  
Event Object Type: cc.cote.jmulator.events.Ipac2Event
Ipac2Event.type property = cc.cote.jmulator.events.Ipac2Event.INPUT_1COIN

Dispatched when there is a change on the board input labeled "1COIN"

The INPUT_1COIN constant defines the value of the type property of a input_1coin event object.
input_1down Event  
Event Object Type: cc.cote.jmulator.events.Ipac2Event
Ipac2Event.type property = cc.cote.jmulator.events.Ipac2Event.INPUT_1DOWN

Dispatched when there is a change on the board input labeled "1DOWN"

The INPUT_1DOWN constant defines the value of the type property of a input_1down event object.
input_1left Event  
Event Object Type: cc.cote.jmulator.events.Ipac2Event
Ipac2Event.type property = cc.cote.jmulator.events.Ipac2Event.INPUT_1LEFT

Dispatched when there is a change on the board input labeled "1LEFT"

The INPUT_1LEFT constant defines the value of the type property of a input_1left event object.
input_1rght Event  
Event Object Type: cc.cote.jmulator.events.Ipac2Event
Ipac2Event.type property = cc.cote.jmulator.events.Ipac2Event.INPUT_1RGHT

Dispatched when there is a change on the board input labeled "1RGHT"

The INPUT_1RGHT constant defines the value of the type property of a input_1rght event object.
input_1strt Event  
Event Object Type: cc.cote.jmulator.events.Ipac2Event
Ipac2Event.type property = cc.cote.jmulator.events.Ipac2Event.INPUT_1STRT

Dispatched when there is a change on the board input labeled "1STRT"

The INPUT_1STRT constant defines the value of the type property of a input_1strt event object.
input_1sw1 Event  
Event Object Type: cc.cote.jmulator.events.Ipac2Event
Ipac2Event.type property = cc.cote.jmulator.events.Ipac2Event.INPUT_1SW1

Dispatched when there is a change on the board input labeled "1SW1"

The INPUT_1SW1 constant defines the value of the type property of a input_1sw1 event object.
input_1sw2 Event  
Event Object Type: cc.cote.jmulator.events.Ipac2Event
Ipac2Event.type property = cc.cote.jmulator.events.Ipac2Event.INPUT_1SW2

Dispatched when there is a change on the board input labeled "1SW2"

The INPUT_1SW2 constant defines the value of the type property of a input_1sw2 event object.
input_1sw3 Event  
Event Object Type: cc.cote.jmulator.events.Ipac2Event
Ipac2Event.type property = cc.cote.jmulator.events.Ipac2Event.INPUT_1SW3

Dispatched when there is a change on the board input labeled "1SW3"

The INPUT_1SW3 constant defines the value of the type property of a input_1sw3 event object.
input_1sw4 Event  
Event Object Type: cc.cote.jmulator.events.Ipac2Event
Ipac2Event.type property = cc.cote.jmulator.events.Ipac2Event.INPUT_1SW4

Dispatched when there is a change on the board input labeled "1SW4"

The INPUT_1SW4 constant defines the value of the type property of a input_1sw4 event object.
input_1sw5 Event  
Event Object Type: cc.cote.jmulator.events.Ipac2Event
Ipac2Event.type property = cc.cote.jmulator.events.Ipac2Event.INPUT_1SW5

Dispatched when there is a change on the board input labeled "1SW5"

The INPUT_1SW5 constant defines the value of the type property of a input_1sw5 event object.
input_1sw6 Event  
Event Object Type: cc.cote.jmulator.events.Ipac2Event
Ipac2Event.type property = cc.cote.jmulator.events.Ipac2Event.INPUT_1SW6

Dispatched when there is a change on the board input labeled "1SW6"

The INPUT_1SW6 constant defines the value of the type property of a input_1sw6 event object.
input_1sw7 Event  
Event Object Type: cc.cote.jmulator.events.Ipac2Event
Ipac2Event.type property = cc.cote.jmulator.events.Ipac2Event.INPUT_1SW7

Dispatched when there is a change on the board input labeled "1SW7"

The INPUT_1SW7 constant defines the value of the type property of a input_1sw7 event object.
input_1sw8 Event  
Event Object Type: cc.cote.jmulator.events.Ipac2Event
Ipac2Event.type property = cc.cote.jmulator.events.Ipac2Event.INPUT_1SW8

Dispatched when there is a change on the board input labeled "1SW8"

The INPUT_1SW8 constant defines the value of the type property of a input_1sw8 event object.
input_1up Event  
Event Object Type: cc.cote.jmulator.events.Ipac2Event
Ipac2Event.type property = cc.cote.jmulator.events.Ipac2Event.INPUT_1UP

Dispatched when there is a change on the board input labeled "1UP"

The INPUT_1UP constant defines the value of the type property of a input_1up event object.
input_2a Event  
Event Object Type: cc.cote.jmulator.events.Ipac2Event
Ipac2Event.type property = cc.cote.jmulator.events.Ipac2Event.INPUT_2A

Dispatched when there is a change on the board input labeled "2A"

The INPUT_2A constant defines the value of the type property of a input_2a event object.
input_2b Event  
Event Object Type: cc.cote.jmulator.events.Ipac2Event
Ipac2Event.type property = cc.cote.jmulator.events.Ipac2Event.INPUT_2B

Dispatched when there is a change on the board input labeled "2B"

The INPUT_2B constant defines the value of the type property of a input_2b event object.
input_2coin Event  
Event Object Type: cc.cote.jmulator.events.Ipac2Event
Ipac2Event.type property = cc.cote.jmulator.events.Ipac2Event.INPUT_2COIN

Dispatched when there is a change on the board input labeled "2COIN"

The INPUT_2COIN constant defines the value of the type property of a input_2coin event object.
input_2down Event  
Event Object Type: cc.cote.jmulator.events.Ipac2Event
Ipac2Event.type property = cc.cote.jmulator.events.Ipac2Event.INPUT_2DOWN

Dispatched when there is a change on the board input labeled "2DOWN"

The INPUT_2DOWN constant defines the value of the type property of a input_2down event object.
input_2left Event  
Event Object Type: cc.cote.jmulator.events.Ipac2Event
Ipac2Event.type property = cc.cote.jmulator.events.Ipac2Event.INPUT_2LEFT

Dispatched when there is a change on the board input labeled "2LEFT"

The INPUT_2LEFT constant defines the value of the type property of a input_2left event object.
input_2rght Event  
Event Object Type: cc.cote.jmulator.events.Ipac2Event
Ipac2Event.type property = cc.cote.jmulator.events.Ipac2Event.INPUT_2RGHT

Dispatched when there is a change on the board input labeled "2RGHT"

The INPUT_2RGHT constant defines the value of the type property of a input_2rght event object.
input_2strt Event  
Event Object Type: cc.cote.jmulator.events.Ipac2Event
Ipac2Event.type property = cc.cote.jmulator.events.Ipac2Event.INPUT_2STRT

Dispatched when there is a change on the board input labeled "2STRT"

The INPUT_2STRT constant defines the value of the type property of a input_2strt event object.
input_2sw1 Event  
Event Object Type: cc.cote.jmulator.events.Ipac2Event
Ipac2Event.type property = cc.cote.jmulator.events.Ipac2Event.INPUT_2SW1

Dispatched when there is a change on the board input labeled "2SW1"

The INPUT_2SW1 constant defines the value of the type property of a input_2sw1 event object.
input_2sw2 Event  
Event Object Type: cc.cote.jmulator.events.Ipac2Event
Ipac2Event.type property = cc.cote.jmulator.events.Ipac2Event.INPUT_2SW2

Dispatched when there is a change on the board input labeled "2SW2"

The INPUT_2SW2 constant defines the value of the type property of a input_2sw2 event object.
input_2sw3 Event  
Event Object Type: cc.cote.jmulator.events.Ipac2Event
Ipac2Event.type property = cc.cote.jmulator.events.Ipac2Event.INPUT_2SW3

Dispatched when there is a change on the board input labeled "2SW3"

The INPUT_2SW3 constant defines the value of the type property of a input_2sw3 event object.
input_2sw4 Event  
Event Object Type: cc.cote.jmulator.events.Ipac2Event
Ipac2Event.type property = cc.cote.jmulator.events.Ipac2Event.INPUT_2SW4

Dispatched when there is a change on the board input labeled "2SW4"

The INPUT_2SW4 constant defines the value of the type property of a input_2sw4 event object.
input_2sw5 Event  
Event Object Type: cc.cote.jmulator.events.Ipac2Event
Ipac2Event.type property = cc.cote.jmulator.events.Ipac2Event.INPUT_2SW5

Dispatched when there is a change on the board input labeled "2SW5"

The INPUT_2SW5 constant defines the value of the type property of a input_2sw5 event object.
input_2sw6 Event  
Event Object Type: cc.cote.jmulator.events.Ipac2Event
Ipac2Event.type property = cc.cote.jmulator.events.Ipac2Event.INPUT_2SW6

Dispatched when there is a change on the board input labeled "2SW6"

The INPUT_2SW6 constant defines the value of the type property of a input_2sw6 event object.
input_2sw7 Event  
Event Object Type: cc.cote.jmulator.events.Ipac2Event
Ipac2Event.type property = cc.cote.jmulator.events.Ipac2Event.INPUT_2SW7

Dispatched when there is a change on the board input labeled "2SW7"

The INPUT_2SW7 constant defines the value of the type property of a input_2sw7 event object.
input_2sw8 Event  
Event Object Type: cc.cote.jmulator.events.Ipac2Event
Ipac2Event.type property = cc.cote.jmulator.events.Ipac2Event.INPUT_2SW8

Dispatched when there is a change on the board input labeled "2SW8"

The INPUT_2SW8 constant defines the value of the type property of a input_2sw8 event object.
input_2up Event  
Event Object Type: cc.cote.jmulator.events.Ipac2Event
Ipac2Event.type property = cc.cote.jmulator.events.Ipac2Event.INPUT_2UP

Dispatched when there is a change on the board input labeled "2UP"

The INPUT_2UP constant defines the value of the type property of a input_2up event object.