Click or drag to resize
DigitalRuneInputMapping Class
Defines a combination of keys, buttons and more that can be used to trigger an action.
Inheritance Hierarchy
SystemObject
  DigitalRune.Game.InputInputMapping

Namespace: DigitalRune.Game.Input
Assembly: DigitalRune.Game.Input (in DigitalRune.Game.Input.dll) Version: 1.8.0.0 (1.8.0.14467)
Syntax
public class InputMapping

The InputMapping type exposes the following members.

Constructors
  NameDescription
Public methodInputMapping
Initializes a new instance of the InputMapping class
Top
Methods
  NameDescription
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Properties
  NameDescription
Public propertyAxis
Gets or sets the analog device input that controls the action.
Public propertyInvert
Gets or sets a value indicating whether the Axis and the positive and negative keys/buttons are inverted.
Public propertyModifierButtons
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.)
Public propertyModifierKeys
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.
Public propertyNegativeButton
Gets or sets the gamepad button that triggers a negative action. (Not available in Silverlight.)
Public propertyNegativeDescription
Gets or sets the description that describes the result of the "negative" buttons, e.g. "Move Left".
Public propertyNegativeKey
Gets or sets the key that triggers a negative action.
Public propertyNegativeMouseButton
Gets or sets the mouse button that triggers a negative action.
Public propertyPositiveButton
Gets or sets the gamepad button that triggers a positive action. (Not available in Silverlight.)
Public propertyPositiveDescription
Gets or sets the description that describes the result of the "positive" buttons, e.g. "Move Right".
Public propertyPositiveKey
Gets or sets the key that triggers a positive action.
Public propertyPositiveMouseButton
Gets or sets the mouse button that triggers a positive action.
Public propertyPressType
Gets or sets the type of the key or button press that triggers the action.
Top
Remarks

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.

See Also