37 key_event(
unsigned short _key = 0,
KeyAction _action =
KA_PRESS,
unsigned char _char = 0,
unsigned char _modifiers = 0,
unsigned char _toggle_keys = 0,
double _time = 0,
int _x = 0,
int _y = 0);
45 void set_key(
unsigned short _key);
63#include <cgv/config/lib_end.h>
event(unsigned int _kind=EID_NONE, unsigned char _modifiers=0, unsigned char _toggle_keys=0, double _time=0)
construct event from its kind
unsigned char get_char() const
return the key as a character
short get_x() const
current mouse x position (origin is top-left of window)
short x
x position of mouse pointer
key_event(unsigned short _key=0, KeyAction _action=KA_PRESS, unsigned char _char=0, unsigned char _modifiers=0, unsigned char _toggle_keys=0, double _time=0, int _x=0, int _y=0)
construct a key event from its textual description
void set_action(KeyAction _action)
set the key event action
unsigned char character
store the corresponding ascii character
void set_key(unsigned short _key)
set the key
short get_y() const
current mouse y position (origin is top-left of window)
void set_char(unsigned char _char)
set the alpha numeric character
unsigned char action
store whether
void stream_in(std::istream &is)
read from stream
void stream_out(std::ostream &os) const
write to stream
unsigned short key
store the pressed key
unsigned short get_key() const
return the key being a capital letter, digit or a value from the Keys enum
KeyAction get_action() const
return the key event action
short y
y position of mouse pointer
namespace that holds the abstract gui interface
KeyAction
different actions that a key can perform
@ KA_REPEAT
key repeated press action
@ KA_PRESS
key press action
@ KA_RELEASE
key release action
std::string get_key_action_string(KeyAction action)
convert a key action into a readable string
this header is dependency free