You'll have no trouble extending InputController to use any external api and transform its events into actions.
you can look at the citrus Keyboard class which is an InputController,(to get a basic idea) or even the Accelerometer controller all here :
when you create an InputController it registers itself to the Input system so you don't have to. the way actions start, change and end is totally up to you, its an interface between your server events, mouse events, touch, accelerometer, joystick whatever to the citrus engine's input system.
a controller doesn't remove itself like citrus objects on each state - careful.
The InputController's methods you'll need :
- triggerON(action name, value, channel) starts an action.
- triggerVALUECHANGE(action name, value, channel) if the action doesn't exist in the system yet, it starts it, otherwise it updates the value - good for control that have continous value change so you can update it (touch pad, joystick, analog signal(?) )
- triggerOFF(action name, value, channel) stops the action.
you can also add actions to the system manually if you want specific action phases for example using Input.addAction(action:InputAction)
Important info about InputAction :
an InputAction starts at phase InputPhase.BEGIN.
it will advance to InputPhase.ON automatically and stay there (you can change its value anytime with triggerVALUECHANGE)
if you think something is missing in our Input system or there's something the InputController class should do and it doesn't, please tell me !