The Open Toolkit library  1.1
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
Public Member Functions | Public Attributes | Properties | List of all members
OpenTK.Input.JoystickState Struct Reference

Describes the current state of a JoystickDevice. More...

Inherits IEquatable< JoystickState >.

Public Member Functions

float GetAxis (JoystickAxis axis)
 Gets a value between -1.0 and 1.0 representing the current offset of the specified JoystickAxis. More...
 
ButtonState GetButton (JoystickButton button)
 Gets the current ButtonState of the specified JoystickButton. More...
 
JoystickHatState GetHat (JoystickHat hat)
 Gets the hat. More...
 
bool IsButtonDown (JoystickButton button)
 Gets a value indicating whether the specified JoystickButton is currently pressed. More...
 
bool IsButtonUp (JoystickButton button)
 Gets a value indicating whether the specified JoystickButton is currently released. More...
 
override string ToString ()
 Returns a System.String that represents the current OpenTK.Input.JoystickState. More...
 
override int GetHashCode ()
 Serves as a hash function for a OpenTK.Input.JoystickState object. More...
 
override bool Equals (object obj)
 Determines whether the specified System.Object is equal to the current OpenTK.Input.JoystickState. More...
 
short GetAxisUnsafe (int index)
 
bool Equals (JoystickState other)
 Determines whether the specified OpenTK.Input.JoystickState is equal to the current OpenTK.Input.JoystickState. More...
 

Public Attributes

const float ConversionFactor = 1.0f / (short.MaxValue + 0.5f)
 
int packet_number
 
int buttons
 
unsafe fixed short axes [MaxAxes]
 
JoystickHatState hat0
 
JoystickHatState hat1
 
JoystickHatState hat2
 
JoystickHatState hat3
 
bool is_connected
 

Properties

bool IsConnected [get]
 Gets a value indicating whether this instance is connected. More...
 

Detailed Description

Describes the current state of a JoystickDevice.

Member Function Documentation

override bool OpenTK.Input.JoystickState.Equals ( object  obj)

Determines whether the specified System.Object is equal to the current OpenTK.Input.JoystickState.

Parameters
objThe System.Object to compare with the current OpenTK.Input.JoystickState.
Returns
true if the specified System.Object is equal to the current OpenTK.Input.JoystickState; otherwise, false.
bool OpenTK.Input.JoystickState.Equals ( JoystickState  other)

Determines whether the specified OpenTK.Input.JoystickState is equal to the current OpenTK.Input.JoystickState.

Parameters
otherThe OpenTK.Input.JoystickState to compare with the current OpenTK.Input.JoystickState.
Returns
true if the specified OpenTK.Input.JoystickState is equal to the current OpenTK.Input.JoystickState; otherwise, false.
float OpenTK.Input.JoystickState.GetAxis ( JoystickAxis  axis)

Gets a value between -1.0 and 1.0 representing the current offset of the specified JoystickAxis.

Returns
A value between -1.0 and 1.0 representing offset of the specified JoystickAxis. If the specified axis does not exist, then the return value is 0.0. Use Joystick.GetCapabilities to query the number of available axes.
Parameters
axisThe JoystickAxis to query.
ButtonState OpenTK.Input.JoystickState.GetButton ( JoystickButton  button)

Gets the current ButtonState of the specified JoystickButton.

Returns
ButtonState.Pressed if the specified button is pressed; otherwise, ButtonState.Released.
Parameters
buttonThe JoystickButton to query.
override int OpenTK.Input.JoystickState.GetHashCode ( )

Serves as a hash function for a OpenTK.Input.JoystickState object.

Returns
A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a hash table.
JoystickHatState OpenTK.Input.JoystickState.GetHat ( JoystickHat  hat)

Gets the hat.

Returns
The hat.
Parameters
hatHat.
bool OpenTK.Input.JoystickState.IsButtonDown ( JoystickButton  button)

Gets a value indicating whether the specified JoystickButton is currently pressed.

Returns
true if the specified button is pressed; otherwise, false.
Parameters
buttonThe JoystickButton to query.
bool OpenTK.Input.JoystickState.IsButtonUp ( JoystickButton  button)

Gets a value indicating whether the specified JoystickButton is currently released.

Returns
true if the specified button is released; otherwise, false.
Parameters
buttonThe JoystickButton to query.
override string OpenTK.Input.JoystickState.ToString ( )

Returns a System.String that represents the current OpenTK.Input.JoystickState.

Returns
A System.String that represents the current OpenTK.Input.JoystickState.

Property Documentation

bool OpenTK.Input.JoystickState.IsConnected
get

Gets a value indicating whether this instance is connected.

true if this instance is connected; otherwise, false.