VoltAir
|
Routes ControllerEvents according to inherent ControllerFactory specifications. More...
Public Member Functions | |
void | onControllerDisconnect (int deviceId) |
Notifies the ControllerManager of device disconnections for all VirtualControllers associated with the specified deviceId . More... | |
virtual bool | routeControllerEvent (ControllerEvent *event) |
Routes the given ControllerEvent. More... | |
Protected Member Functions | |
InputRouter () | |
Constructs an empty InputRouter. More... | |
bool | conflictsWithExistingFactories (const ControllerFactory &factory) const |
Returns whether or not factory conficts (i.e. intersects) with ControllerFactorys previously added to this router. More... | |
bool | hasFactoryRoutes () const |
Returns whether or not this InputRouter contains any ControllerFactorys to route by. More... | |
void | addControllerFactory (ControllerFactory *factory) |
Adds a ControllerFactory to route by. More... | |
void | clearFactories () |
Clears all ControllerFactorys used for routing by this InputRouter. More... | |
Routes ControllerEvents according to inherent ControllerFactory specifications.
InputRouter represents an additional layer of input abstraction on top of ControllerManager to allow events to be routed to different VirtualController instances rather than just according to a 1:1 mapping on deviceId
. This is accomplished by using an intermediate layer of fake deviceIds
. As a result, this allows splitting one device into many based on InputSchemes that compromise the resident ControllerFactorys.
getInstance()
method.
|
protected |
Constructs an empty InputRouter.
|
protected |
Adds a ControllerFactory to route by.
factory | ControllerFactory to add to the InputRouter |
|
protected |
Clears all ControllerFactorys used for routing by this InputRouter.
|
protected |
Returns whether or not factory
conficts (i.e. intersects) with ControllerFactorys previously added to this router.
factory | ControllerFactory to check for conflict |
|
inlineprotected |
Returns whether or not this InputRouter contains any ControllerFactorys to route by.
void InputRouter::onControllerDisconnect | ( | int | deviceId | ) |
Notifies the ControllerManager of device disconnections for all VirtualControllers associated with the specified deviceId
.
deviceId | Id of the device that disconnected. If the deviceId is negative, the device is assumed to be a singleton. |
|
virtual |
Routes the given ControllerEvent.
true
if the event
was both routed properly and handled.