27#include <winpr/wtypes.h>
28#include <freerdp/freerdp.h>
29#include <freerdp/locale/keyboard.h>
32#include "sdl_types.hpp"
45 [[nodiscard]]
bool initialize();
47 [[nodiscard]]
bool keyboard_sync_state();
48 [[nodiscard]]
bool keyboard_focus_in();
50 [[nodiscard]]
bool handleEvent(
const SDL_KeyboardEvent& ev);
52 [[nodiscard]]
bool keyboard_grab(Uint32 windowID,
bool enable);
53 [[nodiscard]]
bool mouse_focus(Uint32 windowID);
54 [[nodiscard]]
bool mouse_grab(Uint32 windowID,
bool enable);
56 [[nodiscard]]
static BOOL keyboard_set_indicators(rdpContext* context, UINT16 led_flags);
57 [[nodiscard]]
static BOOL keyboard_set_ime_status(rdpContext* context, UINT16 imeId,
58 UINT32 imeState, UINT32 imeConvMode);
60 [[nodiscard]]
bool prefToEnabled();
61 [[nodiscard]] uint32_t prefToMask();
62 [[nodiscard]]
static uint32_t prefKeyValue(
const std::string& key,
63 uint32_t fallback = SDL_SCANCODE_UNKNOWN);
66 [[nodiscard]]
static std::list<std::string> tokenize(
const std::string& data,
67 const std::string& delimiter =
",");
68 [[nodiscard]]
static bool extract(
const std::string& token, uint32_t& key, uint32_t& value);
70 [[nodiscard]] UINT32 scancode_to_rdp(Uint32 scancode);
73 Uint32 _lastWindowID = 0;
76 bool _hotkeysEnabled =
false;
77 uint32_t _hotkeyModmask = 0;
78 uint32_t _hotkeyFullscreen = 0;
79 uint32_t _hotkeyResizable = 0;
80 uint32_t _hotkeyGrab = 0;
81 uint32_t _hotkeyDisconnect = 0;
82 uint32_t _hotkeyMinimize = 0;
83 FREERDP_REMAP_TABLE* _remapTable =
nullptr;