class MDeviceState

Jump to documentation

Input device state (OpenMayaUI) (OpenMayaUI.py)

public members:

virtual ~MDeviceState ()
int devicePosition ( const unsigned short int axis) const
int devicePosition ( const MString & axisName ) const
void setDevicePosition ( const int position, const unsigned short int axis)
void setDevicePosition ( const int position, const MString & axisName )
bool buttonState ( const unsigned short int button ) const
bool buttonState ( const MString & buttonName ) const
void setButtonState ( const bool state, const unsigned short int button )
void setButtonState ( const bool state, const MString & buttonName )
int maxAxis () const
bool isNull ()

Documentation

Description

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.

Functions

MDeviceState:: ~MDeviceState ()

Description

Class destructor.

int MDeviceState:: devicePosition ( const unsigned short int axis ) const

Description

Returns the position of the device for the specified axis.

Arguments

  • axis The device axis to be tested

Return value

  • The position of the device for the specified axis

int MDeviceState:: devicePosition ( const MString & axisName ) const

Description

Returns the position of the device for the specified axis.

Arguments

  • axisName The name of the device axis to be tested

Return value

  • The position of the device for the specified axis

void MDeviceState:: setDevicePosition ( const int position, const unsigned short int axis)

Description

Sets the position of the device for the specified axis.

Arguments

  • position The new position value
  • axis The axis of the device to be set

void MDeviceState:: setDevicePosition ( const int position, const MString & axis )

Description

Sets the position of the device for the specified axis.

Arguments

  • position The new position value
  • axis The name of the axis of the device to be set

bool MDeviceState:: buttonState ( const unsigned short int button ) const

Description

Returns the state of the given button.

Arguments

  • button The number of the button to be tested

Return value

  • true button pressed
  • false button released

bool MDeviceState:: buttonState ( const MString & buttonName ) const

Description

Returns the state of the named button.

Arguments

  • buttonName The name of the button to be tested

Return value

  • true button pressed
  • false button released

void MDeviceState:: setButtonState ( const bool state, const unsigned short int button)

Description

Set the state of the specified button.

Arguments

  • state The state to be set (true or false)
  • button The button number

void MDeviceState:: setButtonState ( const bool state, const MString & buttonName)

Description

Set the state of the specified button.

Arguments

  • state The state to be set (true or false)
  • buttonName The name of the button to be set

int MDeviceState:: maxAxis () const

Description

Return the value of the axis with the largest value. This is used to dejitter absolute devices.

Return value

  • The value of the largest axis

bool MDeviceState:: isNull ()

Description

Returns true if this device state is NULL;

Return value

  • true The device state is NULL
  • false The device state is not NULL

This class has no child classes.


Autodesk® Maya® 2008 © 1997-2007 Autodesk, Inc. All rights reserved. doc++ Copyright