Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/Input/Silk.NET.Input.Common/Axis.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,26 @@

namespace Silk.NET.Input.Common
{
/// <summary>
/// Represents a joystick axis.
/// </summary>
public struct Axis
{
/// <summary>
/// The index of this axis.
/// </summary>
public int Index { get; }

/// <summary>
/// The raw position of this axis.
/// </summary>
public float Position { get; }

/// <summary>
/// Creates a new instance of the Axis struct.
/// </summary>
/// <param name="index">The index of this axis.</param>
/// <param name="position">The position of this axis.</param>
public Axis(int index, float position)
{
Index = index;
Expand Down
20 changes: 20 additions & 0 deletions src/Input/Silk.NET.Input.Common/Button.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,32 @@

namespace Silk.NET.Input.Common
{
/// <summary>
/// Represents a joystick button.
/// </summary>
public struct Button
{
/// <summary>
/// The name of this button. Used to determine which button it is.
/// </summary>
public ButtonName Name { get; }

/// <summary>
/// The index of this button.
/// </summary>
public int Index { get; }

/// <summary>
/// Whether or not this button is currently pressed.
/// </summary>
public bool Pressed { get; }

/// <summary>
/// Creates a new instance of the Button struct.
/// </summary>
/// <param name="name"></param>
/// <param name="index"></param>
/// <param name="pressed"></param>
public Button(ButtonName name, int index, bool pressed)
{
Name = name;
Expand Down