SetKey

void SetKey(string description, string primary, [string secondary], [string primaryModifier], [string secondaryModifier])

Parameters

description: The description of what the key (action) is used for.
primary: The primary input to be used for this action.
secondary: Optional. The secondary input to be used for this action. Defaults to None.
primaryModifier: Optional. The modifier key to be used for the primary input.
secondaryModifier: Optional. The modifier key to be used for the secondary input.

Returns

int: The hashcode of description.

Description

Defines the default input settings for the action.

Never use SetKey to change actions! Use ChangeKey() for that.

Example

// this creates a new action called "Left" and binds A and the Left Arrow to it cInput.SetKey("Left", "A", "LeftArrow"); // this uses Keys.D and Keys.RightArrow to accomplish something similar cInput.SetKey("Right", Keys.D, Keys.RightArrow); // creates a new action called "Pause" and binds Escape to it cInput.SetKey("Pause", Keys.Escape); // note that secondary input defaults to None // creates a new action called "Target" with LeftControl as a modifier, making Ctrl-T the "Target" key. cInput.SetKey("Target", Keys.T, Keys.None, Keys.LeftControl, Keys.None);

results matching ""

    No results matching ""