Show / Hide Table of Contents

Class Joystick

Provides access to Joystick devices. Joystick devices provide a varying number of axes and buttons. Use GetCapabilities to retrieve the number of supported axes and buttons on a given device. Use GetState to retrieve the current state of a given device.

Inheritance
Object
Joystick
Inherited Members
Object.ToString()
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Namespace: OpenTK.Input
Assembly: OpenTK.dll
Syntax
public sealed class Joystick

Methods

GetCapabilities(Int32)

Retrieves the JoystickCapabilities of the device connected at the specified index.

Declaration
public static JoystickCapabilities GetCapabilities(int index)
Parameters
Type Name Description
Int32 index

The zero-based index of the device to poll.

Returns
Type Description
JoystickCapabilities

A JoystickCapabilities structure describing the capabilities of the device at the specified index. If no device is connected at the specified index, the IsConnected property of the returned structure will be false.

GetGuid(Int32)

Retrieves the ID of the device connected at the specified index.

Declaration
public static Guid GetGuid(int index)
Parameters
Type Name Description
Int32 index

The zero-based index of the device to poll.

Returns
Type Description
Guid

A Guid representing the id of the connected device.

GetName(Int32)

Declaration
public static string GetName(int index)
Parameters
Type Name Description
Int32 index
Returns
Type Description
String

GetState(Int32)

Retrieves the JoystickState of the device connected at the specified index.

Declaration
public static JoystickState GetState(int index)
Parameters
Type Name Description
Int32 index

The zero-based index of the device to poll.

Returns
Type Description
JoystickState

A JoystickState structure describing the current state of the device at the specified index. If no device is connected at this index, the IsConnected property of the returned structure will be false.

See Also

GamePad
In This Article
Back to top Generated by DocFX