Package | cc.cote.jmulator.emulators |
Class | public class Ipac4 |
Inheritance | Ipac4 ![]() ![]() |
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.Ipac4; import cc.cote.jmulator.events.Ipac4Event; var emu:Ipac4 = new Ipac4(stage); emu.addEventListener(Ipac4Event.INPUT_2COIN, test); function test(e:Ipac4Event):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.
The inputs labeled '3SW5', '3SW6', '3SW7', '3SW8', '4SW5', '4SW6', '4SW7' and '4SW8' are not mapped in the default MAME configuration. Therefore, they cannot be used with this library.
The inputs labeled '1SW4' and '3SW2' cannot be differentiated by Flash therefore they are bound together. The same goes for '1SW1' and '3SW1'.
See also
Method | Defined By | ||
---|---|---|---|
Ipac4(listenOn:InteractiveObject, typematic:Boolean = false, triggering:String)
Creates an Ipac4 object extending the base Emulator object. | Ipac4 | ||
![]() | 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 |
Ipac4 | () | Constructor |
public function Ipac4(listenOn:InteractiveObject, typematic:Boolean = false, triggering:String)
Creates an Ipac4 object extending the base Emulator object. On top of inherited properties, this object defines the board-specific mappings between input label and key code generated.
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
| |
triggering:String (default = NaN ) — The method to use to trigger events. Can be
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.
|