cgv
Loading...
Searching...
No Matches
cgv::gui::shortcut Class Reference

the shortcut class encapsulates a key with modifiers More...

#include <shortcut.h>

Public Member Functions

 shortcut (unsigned short _key=0, unsigned char _mod=0)
void stream_out (std::ostream &os) const
 write to stream
bool stream_in (std::istream &is)
 read from stream
unsigned short get_key () const
 return the key
unsigned char get_modifiers () const
 return the modifier set
void set_key (unsigned short _key)
 set the key
void set_modifiers (unsigned char _modifiers)
 set the modifier set
void validate ()
 ensure that in case of modifier key presses the modifier is not set as such

Protected Attributes

unsigned short key
unsigned char modifiers

Detailed Description

the shortcut class encapsulates a key with modifiers

Definition at line 83 of file shortcut.h.

Constructor & Destructor Documentation

◆ shortcut()

cgv::gui::shortcut::shortcut ( unsigned short _key = 0,
unsigned char _mod = 0 )

Definition at line 85 of file shortcut.cxx.

Member Function Documentation

◆ get_key()

unsigned short cgv::gui::shortcut::get_key ( ) const
inline

return the key

Definition at line 98 of file shortcut.h.

◆ get_modifiers()

unsigned char cgv::gui::shortcut::get_modifiers ( ) const
inline

return the modifier set

Definition at line 100 of file shortcut.h.

◆ set_key()

void cgv::gui::shortcut::set_key ( unsigned short _key)
inline

set the key

Definition at line 102 of file shortcut.h.

◆ set_modifiers()

void cgv::gui::shortcut::set_modifiers ( unsigned char _modifiers)
inline

set the modifier set

Definition at line 104 of file shortcut.h.

◆ stream_in()

bool cgv::gui::shortcut::stream_in ( std::istream & is)

◆ stream_out()

void cgv::gui::shortcut::stream_out ( std::ostream & os) const

write to stream

Definition at line 102 of file shortcut.cxx.

References cgv::gui::get_key_string(), cgv::gui::get_modifier_string(), and stream_out().

Referenced by cgv::gui::operator<<(), and stream_out().

◆ validate()

void cgv::gui::shortcut::validate ( )

ensure that in case of modifier key presses the modifier is not set as such

Definition at line 91 of file shortcut.cxx.

References cgv::gui::EM_ALT, cgv::gui::EM_CTRL, cgv::gui::EM_SHIFT, cgv::gui::KEY_Left_Alt, cgv::gui::KEY_Left_Ctrl, cgv::gui::KEY_Left_Shift, cgv::gui::KEY_Right_Alt, cgv::gui::KEY_Right_Ctrl, cgv::gui::KEY_Right_Shift, and validate().

Referenced by validate().

Member Data Documentation

◆ key

unsigned short cgv::gui::shortcut::key
protected

Definition at line 87 of file shortcut.h.

◆ modifiers

unsigned char cgv::gui::shortcut::modifiers
protected

Definition at line 89 of file shortcut.h.


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