mirror of
https://github.com/debauchee/barrier.git
synced 2024-12-24 11:32:43 +03:00
a5ae8011e2
window. now attaching thread input queues as necessary. shifted code around so toggling toggle keys is immediately reflected by secondary screen's keyboard. now setting extended key flag for keys that need it. fixed handling of shift + caps-lock. added handling of keys that should distinguish between left and right but don't. fixed get/set of active window on leave/enter of primary screen. replaced 1x1 primary window with a full screen window to work around a problem with losing key events. changed calculation of mouse move deltas.
66 lines
1.8 KiB
C++
66 lines
1.8 KiB
C++
#ifndef CMSWINDOWSPRIMARYSCREEN_H
|
|
#define CMSWINDOWSPRIMARYSCREEN_H
|
|
|
|
#include "KeyTypes.h"
|
|
#include "MouseTypes.h"
|
|
#include "CMSWindowsScreen.h"
|
|
#include "IPrimaryScreen.h"
|
|
|
|
class CMSWindowsPrimaryScreen : public CMSWindowsScreen, public IPrimaryScreen {
|
|
public:
|
|
typedef bool (CMSWindowsPrimaryScreen::*HookMethod)(int, WPARAM, LPARAM);
|
|
|
|
CMSWindowsPrimaryScreen();
|
|
virtual ~CMSWindowsPrimaryScreen();
|
|
|
|
// IPrimaryScreen overrides
|
|
virtual void run();
|
|
virtual void stop();
|
|
virtual void open(CServer*);
|
|
virtual void close();
|
|
virtual void enter(SInt32 xAbsolute, SInt32 yAbsolute);
|
|
virtual void leave();
|
|
virtual void warpCursor(SInt32 xAbsolute, SInt32 yAbsolute);
|
|
virtual void setClipboard(ClipboardID, const IClipboard*);
|
|
virtual void grabClipboard(ClipboardID);
|
|
virtual void getSize(SInt32* width, SInt32* height) const;
|
|
virtual SInt32 getJumpZoneSize() const;
|
|
virtual void getClipboard(ClipboardID, IClipboard*) const;
|
|
virtual KeyModifierMask getToggleMask() const;
|
|
|
|
protected:
|
|
// CMSWindowsScreen overrides
|
|
virtual bool onPreTranslate(MSG*);
|
|
virtual LRESULT onEvent(HWND, UINT, WPARAM, LPARAM);
|
|
virtual void onOpenDisplay();
|
|
virtual void onCloseDisplay();
|
|
|
|
private:
|
|
void doEnter();
|
|
|
|
void nextMark();
|
|
|
|
KeyID mapKey(WPARAM keycode, LPARAM info,
|
|
KeyModifierMask* maskOut);
|
|
ButtonID mapButton(WPARAM button) const;
|
|
void updateKeys();
|
|
void updateKey(UINT vkCode, bool press);
|
|
|
|
private:
|
|
CServer* m_server;
|
|
bool m_active;
|
|
HWND m_window;
|
|
HWND m_nextClipboardWindow;
|
|
HWND m_clipboardOwner;
|
|
HWND m_lastForegroundWindow;
|
|
HWND m_lastActiveWindow;
|
|
DWORD m_lastActiveThread;
|
|
HINSTANCE m_hookLibrary;
|
|
UInt32 m_mark;
|
|
UInt32 m_markReceived;
|
|
BYTE m_keys[256];
|
|
SInt32 m_xCenter, m_yCenter;
|
|
};
|
|
|
|
#endif
|