cgv
|
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 |
the shortcut class encapsulates a key with modifiers
Definition at line 83 of file shortcut.h.
cgv::gui::shortcut::shortcut | ( | unsigned short | _key = 0 , |
unsigned char | _mod = 0 |
||
) |
Definition at line 85 of file shortcut.cxx.
|
inline |
return the key
Definition at line 98 of file shortcut.h.
|
inline |
return the modifier set
Definition at line 100 of file shortcut.h.
|
inline |
set the key
Definition at line 102 of file shortcut.h.
|
inline |
set the modifier set
Definition at line 104 of file shortcut.h.
bool cgv::gui::shortcut::stream_in | ( | std::istream & | is | ) |
read from stream
Definition at line 108 of file shortcut.cxx.
References cgv::gui::EM_ALT, cgv::gui::EM_CTRL, cgv::gui::EM_META, cgv::gui::EM_SHIFT, cgv::utils::token::empty(), cgv::utils::token::size(), and cgv::utils::to_upper().
Referenced by cgv::gui::operator>>().
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_modifier_string().
Referenced by cgv::gui::operator<<().
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::KEY_Left_Alt, cgv::gui::KEY_Left_Ctrl, cgv::gui::KEY_Left_Shift, cgv::gui::KEY_Right_Alt, cgv::gui::KEY_Right_Ctrl, and cgv::gui::KEY_Right_Shift.
|
protected |
Definition at line 87 of file shortcut.h.
|
protected |
Definition at line 89 of file shortcut.h.