-
Notifications
You must be signed in to change notification settings - Fork 1
/
MouseDialog.h
154 lines (120 loc) · 3.14 KB
/
MouseDialog.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
#pragma once
#include <xaudio2.h>
#include "Timer.h"
#define fourccRIFF 'FFIR'
#define fourccDATA 'atad'
#define fourccFMT ' tmf'
#define fourccWAVE 'EVAW'
#define fourccXWMA 'AMWX'
#define fourccDPDS 'sdpd'
// MouseDialog dialog
class MouseDialog : public CDialogEx
{
DECLARE_DYNAMIC(MouseDialog)
public:
MouseDialog(CWnd* pParent = nullptr); // standard constructor
virtual ~MouseDialog();
CBrush brushGray, brushWhite, brushGreen, brushOrange, brushDeepOrange, brushRed;
CPen penGray, penWhite, penGreen, penOrange, penDeepOrange, penRed;
COLORREF grayCol = RGB(194, 194, 163),
whiteCol = RGB(255, 255, 255),
greenCol = RGB(0, 153, 0),
orangeCol = RGB(241, 79, 0),
deepOrangeCol = RGB(255, 79, 0),
redCol = RGB(241, 0, 0);
CBrush* pointerCBrush;
CPen* pointerCPen;
POINT cursorPos;
HBRUSH hbrBkgnd;
CRect dlgRect;
float pieSize = 70;
float x_end_pie = pieSize, y_end_pie = pieSize/2;
float pieDeg, pieRad;
CString mStaticInfoText;
#define UWM_CUSTOMRIGHTCLICK (WM_APP+1)
#define UWM_CUSTOMDRAGMAIN (WM_APP+4)
#define UWM_CUSTOMDRAGOPTION (WM_APP+5)
#define UWM_CUSTOMSTARTTRACK (WM_APP+6)
#define UWM_CUSTOMCLICK (WM_APP+7)
bool notDragFlag = true;
bool notDropFlag = true;
bool needSound = true;
bool isNonMainClientArea = false;
bool isNonOptionsClientArea = false;
bool isTimer2Clicks = false;
bool mainSelfDragflag = false;
bool optSelfDragflag = false;
enum ClicksFaces
{
LOSTFACE,//GRAY
NEUTRAL,//WHITE
SMILING,//GREEN
DWELL,//GREEN
ONE_CLICK,//ORANGE
DOUBLE,//DEEP ORANGE
CANCEL,//RED
PAUSE
};
ClicksFaces click = NEUTRAL;
enum Clicks
{
ONE_CL,//ORANGE
DOUBLE_CL,//DEEP ORANGE
RIGHT_CL,//RED
DRAG//,
//DO_NOTHING
};
bool doNothing = true;
bool doubleClick = false;
Clicks mouseClick = ONE_CL;
Clicks prevRightClick = ONE_CL;
CWnd* m_pMainWnd;
HWND hWnd;
static HWND editWnd;
HRESULT hr;
IXAudio2SourceVoice* pSourceVoice;
XAUDIO2_BUFFER buffer = { 0 };
bool playSoundFlag = true;
Timer mouseTimer;
Timer dwellTimer;
double elapsedSeconds;
bool smileMouseLocked = true;
bool dwellMouseLocked = true;
float dwellDisp = 1.0;
float secDwellStartTime = 2.0;
float dwellDuration = 0.8;
float secQuickClick = 0.6;
float secSmile = 0.6;
float secOneClick = 0.9;
float secDoubleClick = 0.9;
float secCancel = 0.3;
float secToOneClickDuration;
float secToDoubleClickDuration;
float secToOneClickCancelDuration;
float secToDoubleClickCancelDuration;
float secDuration = 0;
bool isQuickClick = false;
bool quickSmileUnlocked = true;
// Dialog Data
#ifdef AFX_DESIGN_TIME
enum { IDD = IDD_MOUSE_DIALOG };
#endif
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
DECLARE_MESSAGE_MAP()
public:
afx_msg void OnPaint();
virtual BOOL OnInitDialog();
void rotatePie(double elapsedSeconds, bool isDwell, bool isQuick);
void changePie(ClicksFaces _click);
void moveMouseDlg(int _X, int _Y);
void timerMouseDlg(bool detect);
void quickMouseDlg(bool detect);
void dwellDetecting(float dist);
void initiateStart();
void stopTimers();
void MouseInput();
void playClickSound();
HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
protected:
};