Add a function for getting the active modifiers

This commit is contained in:
Robbert van der Helm
2021-07-31 15:49:47 +02:00
parent c98a9519fe
commit be6fc786ca
2 changed files with 25 additions and 2 deletions
+9 -1
View File
@@ -263,6 +263,14 @@ class Editor {
const bool use_xembed;
private:
/**
* Get the X11 event mask containing the current keyboard modifiers. Because
* we don't want to link with `xcb-xkb` and we also can't really use
* key/motion events for this, we'll do this by querying the pointer
* position instead. Will return a nullopt if that query fails.
*/
std::optional<uint16_t> get_active_modifiers() const noexcept;
/**
* Get the current cursor position, in Win32 screen coordinates. This is
* needed for our `LeaveNotify` handling because `GetCursorPos()` only
@@ -273,7 +281,7 @@ class Editor {
*
* If we cannot obtain the X11 cursor position, then this returns a nullopt.
*/
std::optional<POINT> get_current_pointer_position() const;
std::optional<POINT> get_current_pointer_position() const noexcept;
/**
* Returns `true` if the currently active window (as per