Skip to content

Commit ea70f16

Browse files
committed
changes
1 parent 3224396 commit ea70f16

9 files changed

+92
-4
lines changed

XInputSimulator/xinputsimulator.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717

1818
#include "xinputsimulator.h"
1919

20+
21+
//*************************************************//
22+
//******************M O U S E**********************//
23+
//*************************************************//
2024
void XInputSimulator::mouseMoveTo(int x, int y)
2125
{
2226
implementation->mouseMoveTo(x, y);
@@ -52,6 +56,10 @@ void XInputSimulator::mouseScrollY(int length)
5256
implementation->mouseScrollY(length);
5357
}
5458

59+
//*************************************************//
60+
//***************K E Y B O A R D*******************//
61+
//*************************************************//
62+
5563
void XInputSimulator::keyDown(int key)
5664
{
5765
implementation->keyDown(key);
@@ -62,3 +70,17 @@ void XInputSimulator::keyUp(int key)
6270
implementation->keyUp(key);
6371
}
6472

73+
void XInputSimulator::keyClick(int key)
74+
{
75+
implementation->keyClick(key);
76+
}
77+
78+
void XInputSimulator::charToKeyCode(char key_char)
79+
{
80+
implementation->charToKeyCode(key_char);
81+
}
82+
83+
void XInputSimulator::keySequence(const std::string &sequence)
84+
{
85+
implementation->keySequence(sequence);
86+
}

XInputSimulator/xinputsimulator.h

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,6 @@ class XInputSimulator
6060
return instance;
6161
}
6262

63-
static const int LEFT_MOUSE_BUTTON = 1;
64-
static const int RIGHT_MOUSE_BUTTON = 2;
65-
static const int MIDDLE_MOUSE_BUTTON = 3;
66-
6763
void mouseMoveTo(int x, int y);
6864
void mouseMoveRelative(int x, int y);
6965
void mouseDown(int button);
@@ -74,6 +70,15 @@ class XInputSimulator
7470

7571
void keyDown(int key);
7672
void keyUp(int key);
73+
void keyClick(int key);
74+
75+
void charToKeyCode(char key_char);
76+
void keySequence(const std::string &sequence);
77+
78+
// mouse
79+
static const int LEFT_MOUSE_BUTTON = 1;
80+
static const int RIGHT_MOUSE_BUTTON = 2;
81+
static const int MIDDLE_MOUSE_BUTTON = 3;
7782
};
7883

7984

XInputSimulator/xinputsimulatorimpl.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
#ifndef XINPUTSIMULATORIMPL_H
1919
#define XINPUTSIMULATORIMPL_H
2020

21+
#include <iostream>
22+
2123
class XInputSimulatorImpl
2224
{
2325
public:
@@ -32,8 +34,13 @@ class XInputSimulatorImpl
3234
virtual void mouseScrollX(int length) = 0;
3335
virtual void mouseScrollY(int length) = 0;
3436

37+
3538
virtual void keyDown(int key) = 0;
3639
virtual void keyUp(int key) = 0;
40+
virtual void keyClick(int key) = 0;
41+
42+
virtual void charToKeyCode(char key_char) = 0;
43+
virtual void keySequence(const std::string &sequence) = 0;
3744

3845
};
3946

XInputSimulator/xinputsimulatorimpllinux.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,5 +149,19 @@ void XInputSimulatorImplLinux::keyUp(int key)
149149
throw NotImplementedException();
150150
}
151151

152+
void XInputSimulatorImplLinux::keyClick(int key)
153+
{
154+
throw NotImplementedException();
155+
}
156+
157+
void XInputSimulatorImplLinux::charToKeyCode(char key_char)
158+
{
159+
throw NotImplementedException();
160+
}
161+
void XInputSimulatorImplLinux::keySequence(const std::string &sequence)
162+
{
163+
throw NotImplementedException();
164+
}
165+
152166

153167
#endif // linux

XInputSimulator/xinputsimulatorimpllinux.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ class XInputSimulatorImplLinux : public XInputSimulatorImpl
4848

4949
virtual void keyDown(int key) override;
5050
virtual void keyUp(int key) override;
51+
virtual void keyClick(int key) override;
52+
53+
virtual void charToKeyCode(char key_char) override;
54+
virtual void keySequence(const std::string &sequence) override;
5155

5256
};
5357

XInputSimulator/xinputsimulatorimplmacos.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,4 +187,18 @@ void XInputSimulatorImplMacOs::keyUp(int key)
187187
throw NotImplementedException();
188188
}
189189

190+
void XInputSimulatorImplMacOs::keyClick(int key)
191+
{
192+
throw NotImplementedException();
193+
}
194+
195+
void XInputSimulatorImplMacOs::charToKeyCode(char key_char)
196+
{
197+
throw NotImplementedException();
198+
}
199+
void XInputSimulatorImplMacOs::keySequence(const std::string &sequence)
200+
{
201+
throw NotImplementedException();
202+
}
203+
190204
#endif //apple

XInputSimulator/xinputsimulatorimplmacos.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ class XInputSimulatorImplMacOs : public XInputSimulatorImpl
4545

4646
virtual void keyDown(int key) override;
4747
virtual void keyUp(int key) override;
48+
virtual void keyClick(int key) override;
49+
50+
virtual void charToKeyCode(char key_char) override;
51+
virtual void keySequence(const std::string &sequence) override;
4852
};
4953

5054

XInputSimulator/xinputsimulatorimplwin.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,4 +144,18 @@ void XInputSimulatorImplWin::keyUp(int key)
144144
throw NotImplementedException();
145145
}
146146

147+
void XInputSimulatorImplWin::keyClick(int key)
148+
{
149+
throw NotImplementedException();
150+
}
151+
152+
void XInputSimulatorImplWin::charToKeyCode(char key_char)
153+
{
154+
throw NotImplementedException();
155+
}
156+
void XInputSimulatorImplWin::keySequence(const std::string &sequence)
157+
{
158+
throw NotImplementedException();
159+
}
160+
147161
#endif //win

XInputSimulator/xinputsimulatorimplwin.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ class XInputSimulatorImplWin: public XInputSimulatorImpl
4444

4545
virtual void keyDown(int key) override;
4646
virtual void keyUp(int key) override;
47+
virtual void keyClick(int key) override;
48+
49+
virtual void charToKeyCode(char key_char) override;
50+
virtual void keySequence(const std::string &sequence) override;
4751
};
4852

4953

0 commit comments

Comments
 (0)