89 unsigned char modifiers;
92 shortcut(
unsigned short _key = 0,
unsigned char _mod = 0);
94 void stream_out(std::ostream& os)
const;
96 bool stream_in(std::istream& is);
98 unsigned short get_key()
const {
return key; }
102 void set_key(
unsigned short _key) { key = _key; }
110extern CGV_API std::ostream&
operator << (std::ostream& os,
const shortcut& sc);
113extern CGV_API std::istream&
operator >> (std::istream& is, shortcut& sc);
118#include <cgv/config/lib_end.h>
the shortcut class encapsulates a key with modifiers
unsigned short get_key() const
return the key
unsigned char get_modifiers() const
return the modifier set
void set_modifiers(unsigned char _modifiers)
set the modifier set
void set_key(unsigned short _key)
set the key
Keys
define the names of special keys
@ KEY_Num_Lock
num lock key
@ KEY_Left_Ctrl
left ctrl key
@ KEY_Num_Enter
num pad enter key
@ KEY_Left_Meta
left meta key
@ KEY_Left_Alt
left alt key
@ KEY_Scroll_Lock
scroll lock key
@ KEY_Back_Space
back space key
@ KEY_Page_Down
page down key
@ KEY_Right_Shift
right shift key
@ KEY_Right_Meta
right meta key
@ KEY_Left_Shift
left shift key
@ KEY_Num_Add
num pad key +
@ KEY_Right
right arrow key
@ KEY_Right_Alt
right alt key
@ KEY_Num_Div
num pad key /
@ KEY_Num_Mul
num pad key *
@ KEY_Caps_Lock
caps lock key
@ KEY_Right_Ctrl
right ctrl key
@ KEY_Num_Sub
num pad key -
@ KEY_Num_Dot
num pad key .
std::istream & operator>>(std::istream &is, shortcut &sc)
stream in a shortcut from an input stream
std::ostream & operator<<(std::ostream &os, const shortcut &sc)
stream a shortcut as text to an output stream
std::string get_key_string(unsigned short key)
convert a key code into a readable string