1
+ // Copyright 2013 Dustin Bensing
2
+
3
+ // This file is part of XInputSimulator.
4
+
5
+ // XInputSimulator is free software: you can redistribute it and/or modify
6
+ // it under the terms of the GNU Lesser Public License as published by
7
+ // the Free Software Foundation, either version 3 of the License, or
8
+ // any later version.
9
+
10
+ // XInputSimulator is distributed in the hope that it will be useful,
11
+ // but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ // GNU Lesser Public License for more details.
14
+
15
+ // You should have received a copy of the GNU Lesser Public License
16
+ // along with XInputSimulator. If not, see <http://www.gnu.org/licenses/>.
17
+
18
+
1
19
#ifdef __APPLE__
2
20
3
21
#include < iostream>
15
33
16
34
XInputSimulatorImplMacOs::XInputSimulatorImplMacOs ()
17
35
{
36
+ // TODO
18
37
// this->initCurrentMousePosition();
19
38
20
39
this ->currentX = 500 ;
@@ -33,7 +52,6 @@ void XInputSimulatorImplMacOs::initCurrentMousePosition()
33
52
34
53
void XInputSimulatorImplMacOs::mouseMoveTo (int x, int y)
35
54
{
36
- std::cout << " moveTo mac\n " ;
37
55
38
56
CGEventRef mouseEv = CGEventCreateMouseEvent (
39
57
NULL , kCGEventMouseMoved ,
@@ -52,8 +70,6 @@ void XInputSimulatorImplMacOs::mouseMoveTo(int x, int y)
52
70
53
71
void XInputSimulatorImplMacOs::mouseMoveRelative (int x, int y)
54
72
{
55
- std::cout << " moveRelative mac\n " ;
56
-
57
73
int newX = this ->currentX + x;
58
74
int newY = this ->currentY + y;
59
75
@@ -77,8 +93,6 @@ void XInputSimulatorImplMacOs::mouseDown(int button)
77
93
{
78
94
// throw NotImplementedException();
79
95
80
- std::cout << " mouseDown mac\n " ;
81
-
82
96
CGEventRef mouseEv = CGEventCreateMouseEvent (
83
97
NULL , kCGEventLeftMouseDown ,
84
98
CGPointMake (this ->currentX , this ->currentY ),
@@ -95,8 +109,6 @@ void XInputSimulatorImplMacOs::mouseUp(int button)
95
109
{
96
110
// throw NotImplementedException();
97
111
98
- std::cout << " mouseDown mac\n " ;
99
-
100
112
CGEventRef mouseEv = CGEventCreateMouseEvent (
101
113
NULL , kCGEventLeftMouseUp ,
102
114
CGPointMake (this ->currentX , this ->currentY ),
@@ -118,8 +130,6 @@ void XInputSimulatorImplMacOs::mouseScrollX(int length)
118
130
{
119
131
// throw NotImplementedException();
120
132
121
- std::cout << " scroll x mac " << length << std::endl;
122
-
123
133
int scrollDirection = -1 ; // 1 left -1 right
124
134
125
135
if (length < 0 ){
@@ -150,8 +160,6 @@ void XInputSimulatorImplMacOs::mouseScrollY(int length)
150
160
{
151
161
// throw NotImplementedException();
152
162
153
- std::cout << " scroll y mac " << length << std::endl;
154
-
155
163
int scrollDirection = -1 ; // 1 down -1 up
156
164
157
165
if (length < 0 ){
0 commit comments