public void removeHandler(HandleControllerInputType h, ControlInput.ControllerDescription controllerObject) { if (exclusiveRegisteredHandlers[controllerObject].Contains(h)) { exclusiveRegisteredHandlers[controllerObject].Remove(h); } if (registeredHandlers[controllerObject].Contains(h)) { registeredHandlers[controllerObject].Remove(h); } }
// Register a callback for control events. If the handler is exclusive, then // only the most recent handler will receive events until it deregisters (similar // to modal dialog). public void addHandler(HandleControllerInputType h, ControlInput.ControllerDescription controllerObject, bool exclusive = false) { if (exclusive) { if (!exclusiveRegisteredHandlers[controllerObject].Contains(h)) { exclusiveRegisteredHandlers[controllerObject].Insert(0, h); } } else { if (!registeredHandlers[controllerObject].Contains(h)) { registeredHandlers[controllerObject].Add(h); } } }