code: function(name, definition) {
          var inputs;
          if (Array.isArray(definition)) {
              inputs = definition;
          } else {
              inputs = [];
              if (definition.mouseButtons) {
                  for (var b in definition.mouseButtons) {
                      inputs.push(
                          new MouseButtonToggleInput(definition.mouseButtons[b])
                      );
                  }
              }
              if (definition.keys) {
                  for (var k in definition.keys) {
                      inputs.push(new KeyboardToggleInput(definition.keys[k]));
                  }
              }
          }
          this.destroyTriggerGroup(name);
          this._triggers[name] = {
              name: name,
              input: new ToggleInputGroup(inputs),
              downFor: 0,
              active: false
          };
  
          Crafty.trigger("ControlDefined", { type: "TriggerGroup", name: name });
      }
docs: @
  #.defineTriggerGroup
  @comp Controls
  @kind Method
  
  @sign defineTriggerGroup(string name, obj definition)
  @param name - a name for the trigger group
  @param definition - an object which defines the inputs for the trigger
  
  A trigger group is a set of togglable inputs mapped to the same event.
  If any of the inputs are down, the trigger is considered down.  If all are up, it is considered up.
  When the trigger state changes, a `TriggerInputUp` or `TriggerInputDown` event is fired.
  
  The definition object lists the inputs that are mapped to the trigger:
  - `keys`: An array of Crafty keycodes
  - `mouseButtons`: An array of Crafty mouse button codes
  
  @example
  ~~~
  // Define a trigger group mapped to the left mouse button and the A and B keys.
  Crafty.s("Controls").defineTriggerGroup("MyTrigger", {
  mouseButtons: [Crafty.mouseButtons.LEFT],
  keys: [Crafty.keys.A, Crafty.keys.B]
  });
  ~~~
  
  @see .destroyTriggerGroup
  @see Crafty.mouseButtons
  @see Crafty.keys
  @see Controllable