InputMapping Class |
Namespace: DigitalRune.Game.Input
The InputMapping type exposes the following members.
Name | Description | |
---|---|---|
InputMapping | Initializes a new instance of the InputMapping class |
Name | Description | |
---|---|---|
Equals | (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
Axis |
Gets or sets the analog device input that controls the action.
| |
Invert |
Gets or sets a value indicating whether the Axis and the positive and negative
keys/buttons are inverted.
| |
ModifierButtons |
Gets or sets the modifier buttons that must be down. Gamepad buttons do not trigger any
actions if the modifier buttons are released. (Not available in Silverlight.)
| |
ModifierKeys |
Gets or sets the modifier keys that must be down. Keys and mouse buttons do not trigger
any actions if the modifier keys are released.
| |
NegativeButton |
Gets or sets the gamepad button that triggers a negative action.
(Not available in Silverlight.)
| |
NegativeDescription |
Gets or sets the description that describes the result of the "negative" buttons,
e.g. "Move Left".
| |
NegativeKey |
Gets or sets the key that triggers a negative action.
| |
NegativeMouseButton |
Gets or sets the mouse button that triggers a negative action.
| |
PositiveButton |
Gets or sets the gamepad button that triggers a positive action.
(Not available in Silverlight.)
| |
PositiveDescription |
Gets or sets the description that describes the result of the "positive" buttons,
e.g. "Move Right".
| |
PositiveKey |
Gets or sets the key that triggers a positive action.
| |
PositiveMouseButton |
Gets or sets the mouse button that triggers a positive action.
| |
PressType |
Gets or sets the type of the key or button press that triggers the action.
|
The user can trigger an action by pressing keyboard keys, gamepad buttons or mouse buttons. The user can also use analog input (see Axis). The action is triggered if any of the given keys/buttons are pressed.
The mapping defines "positive" and "negative" keys/buttons. For example, for a "Shoot" command, only the "positive" button is relevant. For a "Move Horizontal" command, the positive button can be used to move left, while the negative buttons can be used to move right. If mapped to a numeric value, the mapping creates -1 if the negative button is pressed and +1 if the positive button is pressed. If no button is pressed, or both positive and negative buttons are pressed concurrently, the value is 0.
Modifiers:ModifierKeys and ModifierButtons can also be specified. The action is only triggered if the modifiers are down while the keys/buttons are pressed. ModifierKeys are only relevant for keyboard and mouse input. ModifierButtons are only relevant for gamepad input.