15 #include <vsg/app/Window.h>
16 #include <vsg/ui/KeyEvent.h>
20 #include <vulkan/vulkan_xcb.h>
31 using KeycodeModifier = std::pair<uint16_t, uint16_t>;
32 using KeycodeMap = std::map<KeycodeModifier, vsg::KeySymbol>;
34 void add(uint16_t keycode, uint16_t modifier, vsg::KeySymbol key);
36 void add(uint16_t keycode, std::initializer_list<std::pair<uint16_t, vsg::KeySymbol>> combinations);
38 vsg::KeySymbol getKeySymbol(uint16_t keycode, uint16_t modifier);
39 vsg::KeyModifier getKeyModifier(vsg::KeySymbol keySym, uint16_t modifier,
bool pressed);
42 KeycodeMap _keycodeMap;
43 uint16_t _modifierMask;
62 const char* instanceExtensionSurfaceName()
const override {
return VK_KHR_XCB_SURFACE_EXTENSION_NAME; }
64 bool valid()
const override;
66 bool visible()
const override;
73 void resize()
override;
78 void _initSurface()
override;
80 xcb_connection_t* _connection =
nullptr;
81 xcb_screen_t* _screen =
nullptr;
82 xcb_window_t _window{};
83 xcb_atom_t _wmProtocols{};
84 xcb_atom_t _wmDeleteWindow{};
86 bool _windowMapped =
false;
88 xcb_timestamp_t _first_xcb_timestamp = 0;
89 vsg::clock::time_point _first_xcb_time_point;
KeyboardMap maps Xcb keyboard events to vsg::KeySymbol.
Definition: Xcb_Window.h:27
Xcb_Surface implements XcbSurface creation.
Definition: Xcb_Window.h:48
Xcb_Window implements Xcb specific window creation, event handling and vulkan Surface setup.
Definition: Xcb_Window.h:55
bool pollEvents(vsg::UIEvents &events) override
get the list of events since the last pollEvents() call by splicing bufferEvents with polled windowin...
void releaseWindow() override
void releaseConnection() override
Instance encapsulates the VkInstance.
Definition: Instance.h:43
Surface encapsulates VkSurfaceKHR.
Definition: Surface.h:22