Public Member Functions

MDeviceState Class Reference

Search for all occurrences

Detailed Description

Input device state.

MDeviceState is a generic event class for input devices. Input device classes (such as MPxMidiInputDevice) are responsible for converting specific event types to an MDeviceState which Maya understands.

Examples:

jlcVcrDevice.cpp.

#include <MDeviceState.h>

List of all members.

Public Member Functions

virtual ~MDeviceState ()
 Class destructor.
int devicePosition (const unsigned short int axis) const
 Returns the position of the device for the specified axis.
int devicePosition (const MString &axisName) const
 Returns the position of the device for the specified axis.
void setDevicePosition (const int position, const unsigned short int axis)
 Sets the position of the device for the specified axis.
void setDevicePosition (const int position, const MString &axisName)
 Sets the position of the device for the specified axis.
bool buttonState (const unsigned short int button) const
 Returns the state of the given button.
bool buttonState (const MString &buttonName) const
 Returns the state of the named button.
void setButtonState (const bool state, const unsigned short int button)
 Set the state of the specified button.
void setButtonState (const bool state, const MString &buttonName)
 Set the state of the specified button.
int maxAxis () const
 Return the value of the axis with the largest value.
bool isNull ()
 Returns true if this device state is NULL;.

Member Function Documentation

int devicePosition ( const unsigned short int  axis) const

Returns the position of the device for the specified axis.

Parameters:
[in]axisThe device axis to be tested
Returns:
The position of the device for the specified axis
int devicePosition ( const MString axisName) const

Returns the position of the device for the specified axis.

Parameters:
[in]axisNameThe name of the device axis to be tested
Returns:
The position of the device for the specified axis
void setDevicePosition ( const int  position,
const unsigned short int  axis 
)

Sets the position of the device for the specified axis.

Parameters:
[in]positionThe new position value
[in]axisThe axis of the device to be set
Examples:
jlcVcrDevice.cpp.
void setDevicePosition ( const int  position,
const MString axis 
)

Sets the position of the device for the specified axis.

Parameters:
[in]positionThe new position value
[in]axisThe name of the axis of the device to be set
bool buttonState ( const unsigned short int  button) const

Returns the state of the given button.

Parameters:
[in]buttonThe number of the button to be tested
Returns:
  • true button pressed
  • false button released
bool buttonState ( const MString buttonName) const

Returns the state of the named button.

Parameters:
[in]buttonNameThe name of the button to be tested
Returns:
  • true button pressed
  • false button released
void setButtonState ( const bool  state,
const unsigned short int  button 
)

Set the state of the specified button.

Parameters:
[in]stateThe state to be set (true or false)
[in]buttonThe button number
Examples:
jlcVcrDevice.cpp.
void setButtonState ( const bool  state,
const MString buttonName 
)

Set the state of the specified button.

Parameters:
[in]stateThe state to be set (true or false)
[in]buttonNameThe name of the button to be set
int maxAxis ( ) const

Return the value of the axis with the largest value.

This is used to dejitter absolute devices.

Returns:
The value of the largest axis
bool isNull ( )

Returns true if this device state is NULL;.

Returns:
  • true The device state is NULL
  • false The device state is not NULL
Examples:
jlcVcrDevice.cpp.

MDeviceState MDeviceState MDeviceState MDeviceState MDeviceState MDeviceState MDeviceState MDeviceState MDeviceState MDeviceState
MDeviceState MDeviceState MDeviceState MDeviceState MDeviceState MDeviceState MDeviceState MDeviceState MDeviceState MDeviceState