MeVisLab Toolbox Reference
ManagedKeyboardShortcut Class Reference

Class ManagedKeyboardShortcut encapsulates the combination of modifier keys and another key that activates a command. More...

#include <ManagedKeyboardShortcut.h>

Inheritance diagram for ManagedKeyboardShortcut:
ManagedActionTrigger

Public Member Functions

 ManagedKeyboardShortcut ()
 The default constructor creates an invalid shortcut. More...
 
 ManagedKeyboardShortcut (int modifiers, SoKeyboardEvent::Key key)
 Creates shortcut with given key and key modifiers; see SoInteraction for possible key modifiers. More...
 
bool matches (int modifiers, SoKeyboardEvent::Key key) const
 
bool isValid () const
 
int getModifiers () const
 
SoKeyboardEvent::Key getKey () const
 
std::string toString () const
 

Static Public Member Functions

static ManagedKeyboardShortcut fromString (const std::string &s)
 Creates a shortcut from a string. More...
 
- 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. More...
 
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. More...
 

Additional Inherited Members

- Public Types inherited from ManagedActionTrigger
enum  {
  NoModifier = 0 , ShiftModifier = 0x10 , ControlModifier = 0x20 , AltModifier = 0x40 ,
  AllModifiersMask = 0x70
}
 Constants to use where keyboard modifiers must be specified. More...
 
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.

◆ 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()

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

◆ getKey()

SoKeyboardEvent::Key ManagedKeyboardShortcut::getKey ( ) const
inline
Returns
required key

Definition at line 45 of file ManagedKeyboardShortcut.h.

◆ getModifiers()

int ManagedKeyboardShortcut::getModifiers ( ) const
inline
Returns
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: