Skip to content

Commit 0db0072

Browse files
committed
little stuff
1 parent a1b5835 commit 0db0072

File tree

2 files changed

+40
-14
lines changed

2 files changed

+40
-14
lines changed

XInputSimulator/xinputsimulatorimplmacos.cpp

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
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+
119
#ifdef __APPLE__
220

321
#include <iostream>
@@ -15,6 +33,7 @@
1533

1634
XInputSimulatorImplMacOs::XInputSimulatorImplMacOs()
1735
{
36+
//TODO
1837
//this->initCurrentMousePosition();
1938

2039
this->currentX = 500;
@@ -33,7 +52,6 @@ void XInputSimulatorImplMacOs::initCurrentMousePosition()
3352

3453
void XInputSimulatorImplMacOs::mouseMoveTo(int x, int y)
3554
{
36-
std::cout << "moveTo mac\n";
3755

3856
CGEventRef mouseEv = CGEventCreateMouseEvent(
3957
NULL, kCGEventMouseMoved,
@@ -52,8 +70,6 @@ void XInputSimulatorImplMacOs::mouseMoveTo(int x, int y)
5270

5371
void XInputSimulatorImplMacOs::mouseMoveRelative(int x, int y)
5472
{
55-
std::cout << "moveRelative mac\n";
56-
5773
int newX = this->currentX + x;
5874
int newY = this->currentY + y;
5975

@@ -77,8 +93,6 @@ void XInputSimulatorImplMacOs::mouseDown(int button)
7793
{
7894
//throw NotImplementedException();
7995

80-
std::cout << "mouseDown mac\n";
81-
8296
CGEventRef mouseEv = CGEventCreateMouseEvent(
8397
NULL, kCGEventLeftMouseDown,
8498
CGPointMake(this->currentX, this->currentY),
@@ -95,8 +109,6 @@ void XInputSimulatorImplMacOs::mouseUp(int button)
95109
{
96110
//throw NotImplementedException();
97111

98-
std::cout << "mouseDown mac\n";
99-
100112
CGEventRef mouseEv = CGEventCreateMouseEvent(
101113
NULL, kCGEventLeftMouseUp,
102114
CGPointMake(this->currentX, this->currentY),
@@ -118,8 +130,6 @@ void XInputSimulatorImplMacOs::mouseScrollX(int length)
118130
{
119131
//throw NotImplementedException();
120132

121-
std::cout << "scroll x mac " << length << std::endl;
122-
123133
int scrollDirection = -1; // 1 left -1 right
124134

125135
if(length < 0){
@@ -150,8 +160,6 @@ void XInputSimulatorImplMacOs::mouseScrollY(int length)
150160
{
151161
//throw NotImplementedException();
152162

153-
std::cout << "scroll y mac " << length << std::endl;
154-
155163
int scrollDirection = -1; // 1 down -1 up
156164

157165
if(length < 0){

XInputSimulator/xinputsimulatorimplmacos.h

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,26 @@
1-
#ifndef XINPUTSIMULATORIMPLMACOS_H
2-
#define XINPUTSIMULATORIMPLMACOS_H
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+
318

419
#ifdef __APPLE__
520

21+
#ifndef XINPUTSIMULATORIMPLMACOS_H
22+
#define XINPUTSIMULATORIMPLMACOS_H
23+
624
#include "xinputsimulatorimpl.h"
725

826
class XInputSimulatorImplMacOs : public XInputSimulatorImpl
@@ -29,6 +47,6 @@ class XInputSimulatorImplMacOs : public XInputSimulatorImpl
2947
virtual void keyUp(int key) override;
3048
};
3149

32-
#endif //apple
3350

3451
#endif // XINPUTSIMULATORIMPLMACOS_H
52+
#endif //apple

0 commit comments

Comments
 (0)