InControl API Reference
BindingSource Class Referenceabstract

The abstract base class for all binding sources. A binding source can be bound to an action and provides an input source. It essentially represents a control bound to an action, whether it be a controller button, a key or combination of keys, or a mouse button, etc. An action may have multiple binding sources bound. An InputDevice may serve as context for a binding source, especially in the case of controllers. For example, the binding source may be "Left Trigger," but when querying a value for the binding, a specific InputDevice must be provided. Not all bindings require an input device. Keyboard or mouse bindings do not. More...

Inheritance diagram for BindingSource:
DeviceBindingSource KeyBindingSource MouseBindingSource UnknownDeviceBindingSource

Public Member Functions

abstract float GetValue (InputDevice inputDevice)
 Read a float value from the binding source in the context of an optional InputDevice. More...
 
abstract bool GetState (InputDevice inputDevice)
 Read a bool value from the binding source in the context of an optional InputDevice. More...
 
abstract bool Equals (BindingSource other)
 Determines whether the specified BindingSource is equal to the current BindingSource. More...
 
override bool Equals (object obj)
 Determines whether the specified object is equal to the current BindingSource. More...
 
override int GetHashCode ()
 Serves as a hash function for a BindingSource object. More...
 
abstract void Save (BinaryWriter writer)
 
abstract void Load (BinaryReader reader, UInt16 dataFormatVersion)
 

Static Public Member Functions

static bool operator== (BindingSource a, BindingSource b)
 Determines whether the specified binding sources are equal. More...
 
static bool operator!= (BindingSource a, BindingSource b)
 Determines whether the specified binding sources are not equal. More...
 

Properties

abstract string Name [get]
 Gets a textual representation of the binding source. More...
 
abstract string DeviceName [get]
 Gets the name of the device this binding source currently represents. More...
 
abstract InputDeviceClass DeviceClass [get]
 Gets the class of device this binding source currently represents. More...
 
abstract InputDeviceStyle DeviceStyle [get]
 Gets the style of device this binding source currently represents. More...
 
abstract BindingSourceType BindingSourceType [get]
 

Detailed Description

The abstract base class for all binding sources. A binding source can be bound to an action and provides an input source. It essentially represents a control bound to an action, whether it be a controller button, a key or combination of keys, or a mouse button, etc. An action may have multiple binding sources bound. An InputDevice may serve as context for a binding source, especially in the case of controllers. For example, the binding source may be "Left Trigger," but when querying a value for the binding, a specific InputDevice must be provided. Not all bindings require an input device. Keyboard or mouse bindings do not.

Member Function Documentation

◆ Equals() [1/2]

abstract bool Equals ( BindingSource  other)
pure virtual

Determines whether the specified BindingSource is equal to the current BindingSource.

Parameters
otherThe BindingSource to compare with the current BindingSource.
Returns
true if the specified BindingSource is equal to the current BindingSource; otherwise, false.

Implemented in UnknownDeviceBindingSource, MouseBindingSource, KeyBindingSource, and DeviceBindingSource.

◆ Equals() [2/2]

override bool Equals ( object  obj)

Determines whether the specified object is equal to the current BindingSource.

Parameters
objThe object to compare with the current BindingSource.
Returns
true if the specified object is equal to the current BindingSource; otherwise, false.

◆ GetHashCode()

override int GetHashCode ( )

Serves as a hash function for a BindingSource object.

Returns
A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a hash table.

◆ GetState()

abstract bool GetState ( InputDevice  inputDevice)
pure virtual

Read a bool value from the binding source in the context of an optional InputDevice.

Returns
true if the value of the binding is non-zero; otherwise false.
Parameters
inputDeviceAn input device which serves as the context for this source, if applicable. Pass in null when not applicable.

Implemented in MouseBindingSource, KeyBindingSource, DeviceBindingSource, and UnknownDeviceBindingSource.

◆ GetValue()

abstract float GetValue ( InputDevice  inputDevice)
pure virtual

Read a float value from the binding source in the context of an optional InputDevice.

Returns
The value, usually in the range -1..1, but not necessarily, for example, in the case of mouse movement.
Parameters
inputDeviceAn input device which serves as the context for this source, if applicable. Pass in null when not applicable.

Implemented in MouseBindingSource, KeyBindingSource, DeviceBindingSource, and UnknownDeviceBindingSource.

◆ operator!=()

static bool operator!= ( BindingSource  a,
BindingSource  b 
)
static

Determines whether the specified binding sources are not equal.

Parameters
aThe first binding source to compare.
bThe second binding source to compare.
Returns
true if the specified binding sources are not equal; otherwise, false.

◆ operator==()

static bool operator== ( BindingSource  a,
BindingSource  b 
)
static

Determines whether the specified binding sources are equal.

Parameters
aThe first binding source to compare.
bThe second binding source to compare.
Returns
true if the specified binding sources are equal; otherwise, false.

Property Documentation

◆ DeviceClass

abstract InputDeviceClass DeviceClass
get

Gets the class of device this binding source currently represents.

The class of the device.

◆ DeviceName

abstract string DeviceName
get

Gets the name of the device this binding source currently represents.

The name of the device.

◆ DeviceStyle

abstract InputDeviceStyle DeviceStyle
get

Gets the style of device this binding source currently represents.

The style of the device.

◆ Name

abstract string Name
get

Gets a textual representation of the binding source.

The name.


The documentation for this class was generated from the following file: