MeVisLab Toolbox Reference
ManagedMouseButtonTrigger Class Reference

#include <ManagedMouseButtonTrigger.h>

Inheritance diagram for ManagedMouseButtonTrigger:
ManagedActionTrigger ManagedMouseWheelTrigger

Public Member Functions

 ManagedMouseButtonTrigger (int triggerMask=0, int ignoreMask=0)
bool isValid () const
 Returns whether this trigger is valid. A trigger is invalid if it matches when no button is pressed.
bool matches (int mask) const
 Returns whether this trigger matches the given mouse button/key modifier combination.
std::string toString () const
 Returns a string representation of this trigger (see fromString()).

Static Public Member Functions

static ManagedMouseButtonTrigger fromString (const std::string &s)
Static Public Member Functions inherited from ManagedActionTrigger
static std::list< std::string > splitString (const std::string &s, char c, bool doNotSplitAtLastChar=false)
static std::string strip (const std::string &s)
 Strips whitespaces away.
template<typename T>
static std::string join (const std::list< T > &l, const std::string &s)
 Joins a list of objects having a .toString() method, using a separator string s.

Friends

class ManagedMouseWheelTrigger

Additional Inherited Members

Public Types inherited from ManagedActionTrigger
enum  {
  NoModifier = 0 , ShiftModifier = 0x10 , ControlModifier = 0x20 , AltModifier = 0x40 ,
  AllModifiersMask = 0x70
}
enum  { Button1Mask = 1 , Button2Mask = 2 , Button3Mask = 4 , AllButtonsMask = 0x07 }
 Same for mouse buttons: More...

Detailed Description

Class ManagedMouseButtonTrigger encapsulates the combination of required and ignored mouse buttons and modifier keys that activate a pointing action.

Definition at line 36 of file ManagedMouseButtonTrigger.h.

Constructor & Destructor Documentation

◆ ManagedMouseButtonTrigger()

ManagedMouseButtonTrigger::ManagedMouseButtonTrigger ( int triggerMask = 0,
int ignoreMask = 0 )
inline

Creates a mouse trigger with a trigger mask and an ignore mask. The masks can be any combination of mouse buttons and keyboard modifiers; see SoInteraction for possible key modifiers.

Definition at line 44 of file ManagedMouseButtonTrigger.h.

Referenced by fromString(), and ManagedMouseWheelTrigger::ManagedMouseWheelTrigger().

Member Function Documentation

◆ fromString()

ManagedMouseButtonTrigger ManagedMouseButtonTrigger::fromString ( const std::string & s)
static

Creates a trigger from a string.

The string will contain a character for every modifier/button:

  • 's' - Shift modifier key,
  • 'c' - Control modifier key,
  • 'a' - Alt modifier key,
  • '1' - first (left) mouse button,
  • '2' - second (middle) mouse button,
  • '3' - third (right) mouse button If such a character is followed by a '?', the key modifier/mouse button is ignored instead of required when matching; otherwise, the key modifier/mouse button must be pressed (or not pressed if the character does not occur at all).

References ManagedMouseButtonTrigger().

◆ isValid()

bool ManagedMouseButtonTrigger::isValid ( ) const
inline

Returns whether this trigger is valid. A trigger is invalid if it matches when no button is pressed.

Definition at line 47 of file ManagedMouseButtonTrigger.h.

References ManagedActionTrigger::AllButtonsMask.

◆ matches()

bool ManagedMouseButtonTrigger::matches ( int mask) const

Returns whether this trigger matches the given mouse button/key modifier combination.

◆ toString()

std::string ManagedMouseButtonTrigger::toString ( ) const

Returns a string representation of this trigger (see fromString()).

◆ ManagedMouseWheelTrigger

friend class ManagedMouseWheelTrigger
friend

Definition at line 38 of file ManagedMouseButtonTrigger.h.

References ManagedMouseWheelTrigger.

Referenced by ManagedMouseWheelTrigger.


The documentation for this class was generated from the following file: