Start implementation of system key capture

This commit is contained in:
Cameron Gutman 2021-01-11 23:43:32 -06:00
commit 30e3b02867
3 changed files with 193 additions and 11 deletions

View file

@ -5,6 +5,11 @@
#include <SDL.h>
#ifdef Q_OS_WIN32
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#endif
#define SDL_CODE_HIDE_CURSOR 1
#define SDL_CODE_SHOW_CURSOR 2
@ -78,6 +83,8 @@ public:
bool isCaptureActive();
bool isSystemKeyCaptureActive();
void setCaptureActive(bool active);
bool isMouseInVideoRegion(int mouseX, int mouseY, int windowWidth = -1, int windowHeight = -1);
@ -117,6 +124,11 @@ private:
static
Uint32 dragTimerCallback(Uint32 interval, void* param);
#ifdef Q_OS_WIN32
static
LRESULT CALLBACK keyboardHookProc(int nCode, WPARAM wParam, LPARAM lParam);
#endif
SDL_Window* m_Window;
bool m_MultiController;
bool m_GamepadMouse;
@ -142,6 +154,7 @@ private:
bool m_FakeCaptureActive;
QString m_OldIgnoreDevices;
QString m_OldIgnoreDevicesExcept;
bool m_CaptureSystemKeysEnabled;
SDL_TouchFingerEvent m_LastTouchDownEvent;
SDL_TouchFingerEvent m_LastTouchUpEvent;