2001-11-19 03:33:36 +03:00
|
|
|
#ifndef CMSWINDOWSSECONDARYSCREEN_H
|
|
|
|
#define CMSWINDOWSSECONDARYSCREEN_H
|
|
|
|
|
|
|
|
#include "CMSWindowsScreen.h"
|
|
|
|
#include "ISecondaryScreen.h"
|
2002-04-30 20:23:03 +04:00
|
|
|
#include <map>
|
|
|
|
#include <vector>
|
2001-11-19 03:33:36 +03:00
|
|
|
|
|
|
|
class CMSWindowsSecondaryScreen : public CMSWindowsScreen, public ISecondaryScreen {
|
2002-04-29 18:40:01 +04:00
|
|
|
public:
|
2001-11-19 03:33:36 +03:00
|
|
|
CMSWindowsSecondaryScreen();
|
|
|
|
virtual ~CMSWindowsSecondaryScreen();
|
|
|
|
|
|
|
|
// ISecondaryScreen overrides
|
|
|
|
virtual void run();
|
|
|
|
virtual void stop();
|
|
|
|
virtual void open(CClient*);
|
|
|
|
virtual void close();
|
2002-04-30 21:48:11 +04:00
|
|
|
virtual void enter(SInt32 xAbsolute, SInt32 yAbsolute,
|
|
|
|
KeyModifierMask mask);
|
2001-11-19 03:33:36 +03:00
|
|
|
virtual void leave();
|
|
|
|
virtual void keyDown(KeyID, KeyModifierMask);
|
|
|
|
virtual void keyRepeat(KeyID, KeyModifierMask, SInt32 count);
|
|
|
|
virtual void keyUp(KeyID, KeyModifierMask);
|
|
|
|
virtual void mouseDown(ButtonID);
|
|
|
|
virtual void mouseUp(ButtonID);
|
|
|
|
virtual void mouseMove(SInt32 xAbsolute, SInt32 yAbsolute);
|
|
|
|
virtual void mouseWheel(SInt32 delta);
|
2002-04-30 20:23:03 +04:00
|
|
|
virtual void setClipboard(ClipboardID, const IClipboard*);
|
|
|
|
virtual void grabClipboard(ClipboardID);
|
2002-05-24 21:54:28 +04:00
|
|
|
virtual void getMousePos(SInt32* x, SInt32* y) const;
|
2001-11-19 03:33:36 +03:00
|
|
|
virtual void getSize(SInt32* width, SInt32* height) const;
|
|
|
|
virtual SInt32 getJumpZoneSize() const;
|
2002-04-30 20:23:03 +04:00
|
|
|
virtual void getClipboard(ClipboardID, IClipboard*) const;
|
2001-11-19 03:33:36 +03:00
|
|
|
|
2002-04-29 18:40:01 +04:00
|
|
|
protected:
|
2001-11-19 03:33:36 +03:00
|
|
|
// CMSWindowsScreen overrides
|
2001-11-25 21:32:41 +03:00
|
|
|
virtual bool onPreTranslate(MSG*);
|
|
|
|
virtual LRESULT onEvent(HWND, UINT, WPARAM, LPARAM);
|
2001-11-19 03:33:36 +03:00
|
|
|
virtual void onOpenDisplay();
|
|
|
|
virtual void onCloseDisplay();
|
|
|
|
|
2002-04-29 18:40:01 +04:00
|
|
|
private:
|
2002-05-04 22:08:22 +04:00
|
|
|
enum EKeyAction { kPress, kRelease, kRepeat };
|
|
|
|
class Keystroke {
|
|
|
|
public:
|
|
|
|
UINT m_virtualKey;
|
|
|
|
bool m_press;
|
|
|
|
bool m_repeat;
|
|
|
|
};
|
2002-04-30 20:23:03 +04:00
|
|
|
typedef std::vector<Keystroke> Keystrokes;
|
|
|
|
|
2002-05-04 22:08:22 +04:00
|
|
|
DWORD mapButton(ButtonID button, bool press) const;
|
2002-04-30 20:23:03 +04:00
|
|
|
KeyModifierMask mapKey(Keystrokes&, UINT& virtualKey, KeyID,
|
2002-05-04 22:08:22 +04:00
|
|
|
KeyModifierMask, EKeyAction) const;
|
|
|
|
void doKeystrokes(const Keystrokes&, SInt32 count);
|
2002-04-30 20:23:03 +04:00
|
|
|
|
|
|
|
void updateKeys();
|
|
|
|
void updateModifiers();
|
2002-04-30 21:48:11 +04:00
|
|
|
void toggleKey(UINT virtualKey, KeyModifierMask mask);
|
2002-05-22 21:01:17 +04:00
|
|
|
UINT virtualKeyToScanCode(UINT& virtualKey);
|
|
|
|
bool isExtendedKey(UINT virtualKey);
|
|
|
|
void sendKeyEvent(UINT virtualKey, bool press);
|
2001-11-19 03:33:36 +03:00
|
|
|
|
2002-04-29 18:40:01 +04:00
|
|
|
private:
|
2001-11-19 03:33:36 +03:00
|
|
|
CClient* m_client;
|
|
|
|
HWND m_window;
|
2001-11-25 21:32:41 +03:00
|
|
|
HWND m_nextClipboardWindow;
|
|
|
|
HWND m_clipboardOwner;
|
2002-04-30 20:23:03 +04:00
|
|
|
|
2002-05-22 21:01:17 +04:00
|
|
|
// thread id of the event loop thread
|
|
|
|
DWORD m_threadID;
|
|
|
|
|
2002-04-30 20:23:03 +04:00
|
|
|
// virtual key states
|
|
|
|
BYTE m_keys[256];
|
|
|
|
|
|
|
|
// current active modifiers
|
|
|
|
KeyModifierMask m_mask;
|
2001-11-19 03:33:36 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|