MeVisLab Toolbox Reference
ManagedKeyboardShortcut Class Reference

#include <ManagedKeyboardShortcut.h>

Inheritance diagram for ManagedKeyboardShortcut:
ManagedActionTrigger

Public Member Functions

 ManagedKeyboardShortcut ()
 The default constructor creates an invalid shortcut.
 ManagedKeyboardShortcut (int modifiers, SoKeyboardEvent::Key key)
 Creates shortcut with given key and key modifiers; see SoInteraction for possible key modifiers.
bool matches (int modifiers, SoKeyboardEvent::Key key) const
 Returns whether the shortcut matches the given modifiers and key; see SoInteraction for possible modifiers.
bool isValid () const
 Returns whether the shortcut is valid.
int getModifiers () const
 Returns the required key modifiers.
SoKeyboardEvent::Key getKey () const
 Returns the required key.
std::string toString () const
 Returns a string representation of this shortcut (see fromString()).

Static Public Member Functions

static ManagedKeyboardShortcut 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.

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 ManagedKeyboardShortcut encapsulates the combination of modifier keys and another key that activates a command.

Definition at line 26 of file ManagedKeyboardShortcut.h.

Constructor & Destructor Documentation

◆ ManagedKeyboardShortcut() [1/2]

ManagedKeyboardShortcut::ManagedKeyboardShortcut ( )
inline

The default constructor creates an invalid shortcut.

Definition at line 30 of file ManagedKeyboardShortcut.h.

References ANY.

Referenced by fromString().

◆ ManagedKeyboardShortcut() [2/2]

ManagedKeyboardShortcut::ManagedKeyboardShortcut ( int modifiers,
SoKeyboardEvent::Key key )
inline

Creates shortcut with given key and key modifiers; see SoInteraction for possible key modifiers.

Definition at line 33 of file ManagedKeyboardShortcut.h.

Member Function Documentation

◆ fromString()

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

Creates a shortcut from a string.

Strings can take the form "[S[hift]-][C[trl]-][A[lt]-]Keyname". For acceptable keynames, look at ManagedKeyboardShortcut.cpp.

References ManagedKeyboardShortcut().

◆ getKey()

SoKeyboardEvent::Key ManagedKeyboardShortcut::getKey ( ) const
inline

Returns the required key.

Definition at line 45 of file ManagedKeyboardShortcut.h.

◆ getModifiers()

int ManagedKeyboardShortcut::getModifiers ( ) const
inline

Returns the required key modifiers.

Definition at line 42 of file ManagedKeyboardShortcut.h.

◆ isValid()

bool ManagedKeyboardShortcut::isValid ( ) const

Returns whether the shortcut is valid.

◆ matches()

bool ManagedKeyboardShortcut::matches ( int modifiers,
SoKeyboardEvent::Key key ) const

Returns whether the shortcut matches the given modifiers and key; see SoInteraction for possible modifiers.

◆ toString()

std::string ManagedKeyboardShortcut::toString ( ) const

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


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