Class GamePadDeviceBase
public abstract class GamePadDeviceBase : IGamePadDevice, IInputDevice
- Inheritance
-
GamePadDeviceBase
- Implements
- Derived
- Extension Methods
Constructors
GamePadDeviceBase()
protected GamePadDeviceBase()
Properties
CanChangeIndex
true
if the index of this gamepad can be changed
public bool CanChangeIndex { get; protected set; }
Property Value
DownButtons
The gamepad buttons that are down
public IReadOnlySet<GamePadButton> DownButtons { get; }
Property Value
Id
The unique identifier of this device
public abstract Guid Id { get; }
Property Value
Index
The index of the gamepad assigned by the input manager
public int Index { get; set; }
Property Value
Remarks
If CanChangeIndex is false, this value can not be changed
Name
The name of the device
public abstract string Name { get; }
Property Value
PressedButtons
The gamepad buttons that have been pressed since the last frame
public IReadOnlySet<GamePadButton> PressedButtons { get; }
Property Value
Priority
The device priority. Larger means higher priority when selecting the first device of some type
public int Priority { get; set; }
Property Value
ProductId
Product Id of the device
public abstract Guid ProductId { get; }
Property Value
ReleasedButtons
The gamepad buttons that have been released since the last frame
public IReadOnlySet<GamePadButton> ReleasedButtons { get; }
Property Value
Source
The input source the device belongs to.
public abstract IInputSource Source { get; }
Property Value
State
The state of the gamepad
public abstract GamePadState State { get; }
Property Value
Methods
ClearButtonStates()
Clears previous Pressed/Released states
protected void ClearButtonStates()
SetIndexInternal(int, bool)
protected void SetIndexInternal(int newIndex, bool isDeviceSideChange = true)
Parameters
SetVibration(float, float, float, float)
Sets 4 vibration motors one the device or approximates the effect if less are supported
public abstract void SetVibration(float smallLeft, float smallRight, float largeLeft, float largeRight)
Parameters
smallLeft
floatThe small left side motor
smallRight
floatThe small right side motor
largeLeft
floatThe large left side motor
largeRight
floatThe large right side motor
Remarks
Values range from 0 to 1, where 0 is off and 1 is maximum vibration
Update(List<InputEvent>)
Updates the input device, filling the list inputEvents
with input events that were generated by this device this frame
public abstract void Update(List<InputEvent> inputEvents)
Parameters
inputEvents
List<InputEvent>A list that gets filled with input events that were generated since the last frame
Remarks
Input devices are always updated after their respective input source
UpdateButtonState(GamePadButtonEvent)
Updates Pressed/Released/Down collections
protected void UpdateButtonState(GamePadButtonEvent evt)
Parameters
Events
IndexChanged
Raised if the index assigned to this gamepad changed
public event EventHandler<GamePadIndexChangedEventArgs> IndexChanged