Hydrogen Framework  1.3.1
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
Hydrogen.Peripherals.InputControlBase Class Referenceabstract
+ Inheritance diagram for Hydrogen.Peripherals.InputControlBase:

Public Types

enum  ControlType { ControlType.KeyboardButton, ControlType.MouseButton, ControlType.Axis, ControlType.DeltaAxis }
 

Public Member Functions

abstract void Capture ()
 

Static Public Member Functions

static InputControlBase CreateControl (String name, InputAction action)
 

Static Public Attributes

static readonly Dictionary
< String, String > 
DeltaAxes
 
static readonly Dictionary
< String, String > 
Axes
 
static readonly Dictionary
< String, int > 
MouseButtons
 
static readonly Dictionary
< String, KeyCode > 
KeyboardButtons
 

Protected Member Functions

 InputControlBase (String name, InputAction action)
 

Properties

string Name [get, set]
 
string ActionName [get, set]
 
InputAction Action [get, set]
 

Detailed Description

Definition at line 36 of file InputControlBase.cs.

Member Enumeration Documentation

Constructor & Destructor Documentation

Hydrogen.Peripherals.InputControlBase.InputControlBase ( String  name,
InputAction  action 
)
protected

Definition at line 328 of file InputControlBase.cs.

329  {
330  Name = name;
331  Action = action;
332  }

Member Function Documentation

static InputControlBase Hydrogen.Peripherals.InputControlBase.CreateControl ( String  name,
InputAction  action 
)
static

Definition at line 308 of file InputControlBase.cs.

309  {
310  string axis;
311  if (Axes.TryGetValue (name, out axis)) {
312  return new InputAxisControl (name, axis, action);
313  }
314  if (DeltaAxes.TryGetValue (name, out axis)) {
315  return new InputDeltaAxisControl (name, axis, action);
316  }
317  int button;
318  if (MouseButtons.TryGetValue (name, out button)) {
319  return new InputMouseButtonControl (name, button, action);
320  }
321  KeyCode keyCode;
322  if (KeyboardButtons.TryGetValue (name, out keyCode)) {
323  return new InputKeyboardButtonControl (name, keyCode, action);
324  }
325  return null;
326  }
static readonly Dictionary< String, String > DeltaAxes
static readonly Dictionary< String, KeyCode > KeyboardButtons
static readonly Dictionary< String, String > Axes
static readonly Dictionary< String, int > MouseButtons

Member Data Documentation

readonly Dictionary<String, String> Hydrogen.Peripherals.InputControlBase.Axes
static
Initial value:
= new Dictionary<String, String> {
{ "Horizontal", "Horizontal" },
{ "Vertical", "Vertical" }
}

Definition at line 46 of file InputControlBase.cs.

readonly Dictionary<String, String> Hydrogen.Peripherals.InputControlBase.DeltaAxes
static
Initial value:
= new Dictionary<String, String> {
{ "Mouse X", "Mouse X" },
{ "Mouse Y", "Mouse Y" },
{ "Mouse ScrollWheel", "Mouse ScrollWheel" }
}

Definition at line 41 of file InputControlBase.cs.

readonly Dictionary<String, KeyCode> Hydrogen.Peripherals.InputControlBase.KeyboardButtons
static

Definition at line 55 of file InputControlBase.cs.

readonly Dictionary<String, int> Hydrogen.Peripherals.InputControlBase.MouseButtons
static
Initial value:
= new Dictionary<String, int> {
{ "Left", 0 },
{ "Right", 1 },
{ "Middle", 2 },
}

Definition at line 50 of file InputControlBase.cs.

Property Documentation

InputAction Hydrogen.Peripherals.InputControlBase.Action
getset

Definition at line 340 of file InputControlBase.cs.

string Hydrogen.Peripherals.InputControlBase.ActionName
getset

Definition at line 338 of file InputControlBase.cs.

string Hydrogen.Peripherals.InputControlBase.Name
getset

Definition at line 336 of file InputControlBase.cs.