Gamp v0.0.7-36-g24b1eb6
Gamp: Graphics, Audio, Multimedia and Processing
Loading...
Searching...
No Matches
gamp::wt::event Namespace Reference

Classes

class  InputEvent
 
class  KeyboardTracker
 
class  KeyEvent
  More...
 
class  KeyEventManager
 
class  KeyListener
 Listener for multiple KeyEvent. More...
 
class  PointerEvent
 Pointer event of type PointerType. More...
 
class  PointerEventManager
 
class  PointerListener
 Listener for PointerEvent. More...
 
class  WindowEvent
 
class  WindowEventManager
 
class  WindowListener
 Listener for multiple WindowEvent. More...
 
class  WTEvent
 

Typedefs

typedef std::shared_ptr< KeyListenerKeyListenerRef
 
typedef std::shared_ptr< PointerListenerPointerListenerRef
 
typedef std::shared_ptr< WindowListenerWindowListenerRef
 

Enumerations

enum class  InputButton : uint16_t {
  InputButton::none = 0 , InputButton::button1 = 1 , InputButton::button2 = 2 , InputButton::button3 = 3 ,
  InputButton::button4 = 4 , InputButton::button5 = 5 , InputButton::button6 = 6 , InputButton::button7 = 7 ,
  InputButton::button8 = 8 , InputButton::button9 = 9 , InputButton::button10 = 10 , InputButton::button11 = 11 ,
  InputButton::button12 = 12 , InputButton::button13 = 13 , InputButton::button14 = 14 , InputButton::button15 = 15 ,
  InputButton::button16 = 16 , InputButton::button_count = 16
}
 
enum class  InputModifier : uint32_t {
  InputModifier::none = 0 , InputModifier::lshift = 1U << 0 , InputModifier::rshift = 1U << 1 , InputModifier::lctrl = 1U << 2 ,
  InputModifier::rctrl = 1U << 3 , InputModifier::lalt = 1U << 4 , InputModifier::ralt = 1U << 5 , InputModifier::lmeta = 1U << 6 ,
  InputModifier::rmeta = 1U << 7 , InputModifier::shift = lshift | rshift , InputModifier::ctrl = lctrl | rctrl , InputModifier::alt = lalt | ralt ,
  InputModifier::meta = lmeta | rmeta , InputModifier::modifier = shift | ctrl | alt | meta , InputModifier::button1_bit = 8 , InputModifier::button1 = 1U << button1_bit ,
  InputModifier::button2 = 1U << 9 , InputModifier::button3 = 1U << 10 , InputModifier::button4 = 1U << 11 , InputModifier::button5 = 1U << 12 ,
  InputModifier::button6 = 1U << 13 , InputModifier::button7 = 1U << 14 , InputModifier::button8 = 1U << 15 , InputModifier::button9 = 1U << 16 ,
  InputModifier::button10 = 1U << 17 , InputModifier::button11 = 1U << 18 , InputModifier::button12 = 1U << 19 , InputModifier::button13 = 1U << 20 ,
  InputModifier::button14 = 1U << 21 , InputModifier::button15 = 1U << 22 , InputModifier::button16 = 1U << 23 , InputModifier::button_last = button16 ,
  InputModifier::button_all = 0xffffU << 8 , InputModifier::repeat = 1U << 29 , InputModifier::confined = 1U << 30 , InputModifier::invisible = 1U << 31
}
 
enum class  PointerClass : uint16_t { PointerClass::none = 0 , PointerClass::offscreen = 1U << 14 , PointerClass::onscreen = 1U << 15 }
 Class of pointer types. More...
 
enum class  PointerType : uint16_t {
  PointerType::none = 0 , PointerType::mouse = number(PointerClass::offscreen) | 1U << 0 , PointerType::touchpad = number(PointerClass::offscreen) | 1U << 1 , PointerType::touchscreen = number(PointerClass::onscreen) | 1U << 2 ,
  PointerType::pen = number(PointerClass::offscreen) | 1U << 3
}
 Type of pointer devices. More...
 
enum class  VKeyCode : uint16_t {
  VKeyCode::VK_UNDEFINED = 0 , VKeyCode::none = VK_UNDEFINED , VKeyCode::VK_FREE01 = 0x01u , VKeyCode::VK_HOME = 0x02u ,
  VKeyCode::VK_END = 0x03u , VKeyCode::VK_FINAL = 0x04u , VKeyCode::VK_PRINTSCREEN = 0x05u , VKeyCode::VK_FREE06 = 0x06u ,
  VKeyCode::VK_FREE07 = 0x07u , VKeyCode::VK_BACK_SPACE = 0x08u , VKeyCode::VK_TAB = 0x09u , VKeyCode::VK_LINEFEED = 0x0Au ,
  VKeyCode::VK_PAGE_DOWN = 0x0Bu , VKeyCode::VK_CLEAR = 0x0Cu , VKeyCode::VK_ENTER = 0x0Du , VKeyCode::VK_FREE0E = 0x0Eu ,
  VKeyCode::VK_SHIFT = 0x0Fu , VKeyCode::VK_PAGE_UP = 0x10u , VKeyCode::VK_CONTROL = 0x11u , VKeyCode::VK_ALT = 0x12u ,
  VKeyCode::VK_FREE13 = 0x13u , VKeyCode::VK_CAPS_LOCK = 0x14u , VKeyCode::VK_FREE15 = 0x15u , VKeyCode::VK_PAUSE = 0x16u ,
  VKeyCode::VK_SCROLL_LOCK = 0x17u , VKeyCode::VK_CANCEL = 0x18u , VKeyCode::VK_FREE19 = 0x19u , VKeyCode::VK_INSERT = 0x1Au ,
  VKeyCode::VK_ESCAPE = 0x1Bu , VKeyCode::VK_CONVERT = 0x1Cu , VKeyCode::VK_NONCONVERT = 0x1Du , VKeyCode::VK_ACCEPT = 0x1Eu ,
  VKeyCode::VK_MODECHANGE = 0x1Fu , VKeyCode::VK_SPACE = 0x20u , VKeyCode::VK_EXCLAMATION_MARK = 0x21u , VKeyCode::VK_QUOTEDBL = 0x22u ,
  VKeyCode::VK_NUMBER_SIGN = 0x23u , VKeyCode::VK_DOLLAR = 0x24u , VKeyCode::VK_PERCENT = 0x25u , VKeyCode::VK_AMPERSAND = 0x26u ,
  VKeyCode::VK_QUOTE = 0x27u , VKeyCode::VK_LEFT_PARENTHESIS = 0x28u , VKeyCode::VK_RIGHT_PARENTHESIS = 0x29u , VKeyCode::VK_ASTERISK = 0x2Au ,
  VKeyCode::VK_PLUS = 0x2Bu , VKeyCode::VK_COMMA = 0x2Cu , VKeyCode::VK_MINUS = 0x2Du , VKeyCode::VK_PERIOD = 0x2Eu ,
  VKeyCode::VK_SLASH = 0x2Fu , VKeyCode::VK_0 = 0x30u , VKeyCode::VK_1 = 0x31u , VKeyCode::VK_2 = 0x32u ,
  VKeyCode::VK_3 = 0x33u , VKeyCode::VK_4 = 0x34u , VKeyCode::VK_5 = 0x35u , VKeyCode::VK_6 = 0x36u ,
  VKeyCode::VK_7 = 0x37u , VKeyCode::VK_8 = 0x38u , VKeyCode::VK_9 = 0x39u , VKeyCode::VK_COLON = 0x3Au ,
  VKeyCode::VK_SEMICOLON = 0x3Bu , VKeyCode::VK_LESS = 0x3Cu , VKeyCode::VK_EQUALS = 0x3Du , VKeyCode::VK_GREATER = 0x3Eu ,
  VKeyCode::VK_QUESTIONMARK = 0x3Fu , VKeyCode::VK_AT = 0x40u , VKeyCode::VK_A = 0x41u , VKeyCode::VK_B = 0x42u ,
  VKeyCode::VK_C = 0x43u , VKeyCode::VK_D = 0x44u , VKeyCode::VK_E = 0x45u , VKeyCode::VK_F = 0x46u ,
  VKeyCode::VK_G = 0x47u , VKeyCode::VK_H = 0x48u , VKeyCode::VK_I = 0x49u , VKeyCode::VK_J = 0x4Au ,
  VKeyCode::VK_K = 0x4Bu , VKeyCode::VK_L = 0x4Cu , VKeyCode::VK_M = 0x4Du , VKeyCode::VK_N = 0x4Eu ,
  VKeyCode::VK_O = 0x4Fu , VKeyCode::VK_P = 0x50u , VKeyCode::VK_Q = 0x51u , VKeyCode::VK_R = 0x52u ,
  VKeyCode::VK_S = 0x53u , VKeyCode::VK_T = 0x54u , VKeyCode::VK_U = 0x55u , VKeyCode::VK_V = 0x56u ,
  VKeyCode::VK_W = 0x57u , VKeyCode::VK_X = 0x58u , VKeyCode::VK_Y = 0x59u , VKeyCode::VK_Z = 0x5Au ,
  VKeyCode::VK_OPEN_BRACKET = 0x5Bu , VKeyCode::VK_BACK_SLASH = 0x5Cu , VKeyCode::VK_CLOSE_BRACKET = 0x5Du , VKeyCode::VK_CIRCUMFLEX = 0x5Eu ,
  VKeyCode::VK_UNDERSCORE = 0x5Fu , VKeyCode::VK_BACK_QUOTE = 0x60u , VKeyCode::VK_F1 = ( 0x60U + 1U ) , VKeyCode::VK_F2 = ( 0x60U + 2U ) ,
  VKeyCode::VK_F3 = ( 0x60U + 3U ) , VKeyCode::VK_F4 = ( 0x60U + 4U ) , VKeyCode::VK_F5 = ( 0x60U + 5U ) , VKeyCode::VK_F6 = ( 0x60U + 6U ) ,
  VKeyCode::VK_F7 = ( 0x60U + 7U ) , VKeyCode::VK_F8 = ( 0x60U + 8U ) , VKeyCode::VK_F9 = ( 0x60U + 9U ) , VKeyCode::VK_F10 = ( 0x60U +10U ) ,
  VKeyCode::VK_F11 = ( 0x60U +11U ) , VKeyCode::VK_F12 = ( 0x60U +12U ) , VKeyCode::VK_F13 = ( 0x60U +13U ) , VKeyCode::VK_F14 = ( 0x60U +14U ) ,
  VKeyCode::VK_F15 = ( 0x60U +15U ) , VKeyCode::VK_F16 = ( 0x60U +16U ) , VKeyCode::VK_F17 = ( 0x60U +17U ) , VKeyCode::VK_F18 = ( 0x60U +18U ) ,
  VKeyCode::VK_F19 = ( 0x60U +19U ) , VKeyCode::VK_F20 = ( 0x60U +20U ) , VKeyCode::VK_F21 = ( 0x60U +21U ) , VKeyCode::VK_F22 = ( 0x60U +22U ) ,
  VKeyCode::VK_F23 = ( 0x60U +23U ) , VKeyCode::VK_F24 = ( 0x60U +24U ) , VKeyCode::VK_LEFT_BRACE = 0x7Bu , VKeyCode::VK_PIPE = 0x7Cu ,
  VKeyCode::VK_RIGHT_BRACE = 0x7Du , VKeyCode::VK_TILDE = 0x7Eu , VKeyCode::VK_SEPARATOR = 0x7Fu , VKeyCode::VK_NUMPAD0 = 0x80u ,
  VKeyCode::VK_NUMPAD1 = 0x81u , VKeyCode::VK_NUMPAD2 = 0x82u , VKeyCode::VK_NUMPAD3 = 0x83u , VKeyCode::VK_NUMPAD4 = 0x84u ,
  VKeyCode::VK_NUMPAD5 = 0x85u , VKeyCode::VK_NUMPAD6 = 0x86u , VKeyCode::VK_NUMPAD7 = 0x87u , VKeyCode::VK_NUMPAD8 = 0x88u ,
  VKeyCode::VK_NUMPAD9 = 0x89u , VKeyCode::VK_DECIMAL = 0x8Au , VKeyCode::VK_ADD = 0x8Bu , VKeyCode::VK_SUBTRACT = 0x8Cu ,
  VKeyCode::VK_MULTIPLY = 0x8Du , VKeyCode::VK_DIVIDE = 0x8Eu , VKeyCode::VK_DELETE = 0x93u , VKeyCode::VK_NUM_LOCK = 0x94u ,
  VKeyCode::VK_LEFT = 0x95u , VKeyCode::VK_UP = 0x96u , VKeyCode::VK_RIGHT = 0x97u , VKeyCode::VK_DOWN = 0x98u ,
  VKeyCode::VK_CONTEXT_MENU = 0x99u , VKeyCode::VK_WINDOWS = 0x9Au , VKeyCode::VK_META = 0x9Bu , VKeyCode::VK_HELP = 0x9Cu ,
  VKeyCode::VK_COMPOSE = 0x9Du , VKeyCode::VK_BEGIN = 0x9Eu , VKeyCode::VK_STOP = 0x9Fu , VKeyCode::VK_INVERTED_EXCLAMATION_MARK = 0xA1u ,
  VKeyCode::VK_EURO_SIGN = 0x20ACu , VKeyCode::VK_CUT = 0xF879u , VKeyCode::VK_COPY = 0xF87Au , VKeyCode::VK_PASTE = 0xF87Bu ,
  VKeyCode::VK_UNDO = 0xF87Cu , VKeyCode::VK_AGAIN = 0xF87Du , VKeyCode::VK_FIND = 0xF87Eu , VKeyCode::VK_PROPS = 0xF87Fu ,
  VKeyCode::VK_INPUT_METHOD_ON_OFF = 0xF890u , VKeyCode::VK_CODE_INPUT = 0xF891u , VKeyCode::VK_ROMAN_CHARACTERS = 0xF892u , VKeyCode::VK_ALL_CANDIDATES = 0xF893u ,
  VKeyCode::VK_PREVIOUS_CANDIDATE = 0xF894u , VKeyCode::VK_ALPHANUMERIC = 0xF895u , VKeyCode::VK_KATAKANA = 0xF896u , VKeyCode::VK_HIRAGANA = 0xF897u ,
  VKeyCode::VK_FULL_WIDTH = 0xF898u , VKeyCode::VK_HALF_WIDTH = 0xF89Au , VKeyCode::VK_JAPANESE_KATAKANA = 0xF89Bu , VKeyCode::VK_JAPANESE_HIRAGANA = 0xF89Cu ,
  VKeyCode::VK_JAPANESE_ROMAN = 0xF89Du , VKeyCode::VK_KANA_LOCK = 0xF89Fu , VKeyCode::VK_KEYBOARD_INVISIBLE = 0xF8FFu
}
 Virtual key code following UTF16 specification. More...
 

Functions

constexpr PointerClass getPointerClass (PointerType pt) noexcept
 
constexpr bool isModifierKey (VKeyCode vKey)
 Returns true if the given virtualKey represents a modifier key, otherwise false.
 
bool isPrintableKey (uint16_t uniChar, bool isKeyChar) noexcept
 Returns true if given uniChar represents a printable character, i.e.
 
bool isPrintableKey (VKeyCode vKey, bool isKeyChar) noexcept
 Returns true if given uniCode represents a printable character, i.e.
 
 JAU_MAKE_BITFIELD_ENUM_STRING (InputModifier, lshift, rshift, lctrl, rctrl, lalt, ralt, lmeta, rmeta, button1, button2, button3, button4, button5, button6, button7, button8, button9, button10, button11, button12, button13, button14, button15, button16, repeat, confined, invisible)
 
 JAU_MAKE_ENUM_INFO (InputButton, button1, button2, button3, button4, button5, button6, button7, button8, button9, button10, button11, button12, button13, button14, button15, button16)
 
 JAU_MAKE_ENUM_STRING (InputButton, button1, button2, button3, button4, button5, button6, button7, button8, button9, button10, button11, button12, button13, button14, button15, button16)
 
 JAU_MAKE_ENUM_STRING (PointerClass, offscreen, onscreen)
 
 JAU_MAKE_ENUM_STRING (PointerType, mouse, touchpad, touchscreen, pen)
 
constexpr uint16_t operator* (const VKeyCode v) noexcept
 
std::ostream & operator<< (std::ostream &out, const InputEvent &v)
 
std::ostream & operator<< (std::ostream &out, const KeyEvent &v)
 
std::ostream & operator<< (std::ostream &out, const WindowEvent &v)
 
std::ostream & operator<< (std::ostream &out, const WTEvent &v)
 
constexpr bool operator== (const VKeyCode lhs, const VKeyCode rhs) noexcept
 
constexpr VKeyCode toVKeyCode (uint16_t keyChar) noexcept
 

Variables

static constexpr uint16_t EVENT_KEY_PRESSED = 300
 A key has been pressed, excluding auto-repeat-modifier keys.
 
static constexpr uint16_t EVENT_KEY_RELEASED = 301
 A key has been released, excluding auto-repeat-modifier keys.
 
static constexpr short EVENT_POINTER_CLICKED = 200
 
static constexpr short EVENT_POINTER_DRAGGED = 206
 
static constexpr short EVENT_POINTER_ENTERED = 201
 Only generated for PointerType::mouse.
 
static constexpr short EVENT_POINTER_EXITED = 202
 Only generated for PointerType::mouse.
 
static constexpr short EVENT_POINTER_MOVED = 205
 
static constexpr short EVENT_POINTER_PRESSED = 203
 
static constexpr short EVENT_POINTER_RELEASED = 204
 
static constexpr short EVENT_POINTER_WHEEL = 207
 
static constexpr uint16_t EVENT_WINDOW_DESTROY_NOTIFY = 102
 
static constexpr uint16_t EVENT_WINDOW_DESTROYED = 105
 
static constexpr uint16_t EVENT_WINDOW_FOCUS_CHANGED = 103
 
static constexpr uint16_t EVENT_WINDOW_MOVED = 101
 
static constexpr uint16_t EVENT_WINDOW_REPAINT = 104
 
static constexpr uint16_t EVENT_WINDOW_RESIZED = 100
 
static constexpr uint16_t EVENT_WINDOW_VISIBILITY_CHANGED = 106