File tree Expand file tree Collapse file tree 9 files changed +92
-4
lines changed Expand file tree Collapse file tree 9 files changed +92
-4
lines changed Original file line number Diff line number Diff line change 17
17
18
18
#include " xinputsimulator.h"
19
19
20
+
21
+ // *************************************************//
22
+ // ******************M O U S E**********************//
23
+ // *************************************************//
20
24
void XInputSimulator::mouseMoveTo (int x, int y)
21
25
{
22
26
implementation->mouseMoveTo (x, y);
@@ -52,6 +56,10 @@ void XInputSimulator::mouseScrollY(int length)
52
56
implementation->mouseScrollY (length);
53
57
}
54
58
59
+ // *************************************************//
60
+ // ***************K E Y B O A R D*******************//
61
+ // *************************************************//
62
+
55
63
void XInputSimulator::keyDown (int key)
56
64
{
57
65
implementation->keyDown (key);
@@ -62,3 +70,17 @@ void XInputSimulator::keyUp(int key)
62
70
implementation->keyUp (key);
63
71
}
64
72
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
+ }
Original file line number Diff line number Diff line change @@ -60,10 +60,6 @@ class XInputSimulator
60
60
return instance;
61
61
}
62
62
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
-
67
63
void mouseMoveTo (int x, int y);
68
64
void mouseMoveRelative (int x, int y);
69
65
void mouseDown (int button);
@@ -74,6 +70,15 @@ class XInputSimulator
74
70
75
71
void keyDown (int key);
76
72
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 ;
77
82
};
78
83
79
84
Original file line number Diff line number Diff line change 18
18
#ifndef XINPUTSIMULATORIMPL_H
19
19
#define XINPUTSIMULATORIMPL_H
20
20
21
+ #include < iostream>
22
+
21
23
class XInputSimulatorImpl
22
24
{
23
25
public:
@@ -32,8 +34,13 @@ class XInputSimulatorImpl
32
34
virtual void mouseScrollX (int length) = 0;
33
35
virtual void mouseScrollY (int length) = 0;
34
36
37
+
35
38
virtual void keyDown (int key) = 0;
36
39
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;
37
44
38
45
};
39
46
Original file line number Diff line number Diff line change @@ -149,5 +149,19 @@ void XInputSimulatorImplLinux::keyUp(int key)
149
149
throw NotImplementedException ();
150
150
}
151
151
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
+
152
166
153
167
#endif // linux
Original file line number Diff line number Diff line change @@ -48,6 +48,10 @@ class XInputSimulatorImplLinux : public XInputSimulatorImpl
48
48
49
49
virtual void keyDown (int key) override ;
50
50
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 ;
51
55
52
56
};
53
57
Original file line number Diff line number Diff line change @@ -187,4 +187,18 @@ void XInputSimulatorImplMacOs::keyUp(int key)
187
187
throw NotImplementedException ();
188
188
}
189
189
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
+
190
204
#endif // apple
Original file line number Diff line number Diff line change @@ -45,6 +45,10 @@ class XInputSimulatorImplMacOs : public XInputSimulatorImpl
45
45
46
46
virtual void keyDown (int key) override ;
47
47
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 ;
48
52
};
49
53
50
54
Original file line number Diff line number Diff line change @@ -144,4 +144,18 @@ void XInputSimulatorImplWin::keyUp(int key)
144
144
throw NotImplementedException ();
145
145
}
146
146
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
+
147
161
#endif // win
Original file line number Diff line number Diff line change @@ -44,6 +44,10 @@ class XInputSimulatorImplWin: public XInputSimulatorImpl
44
44
45
45
virtual void keyDown (int key) override ;
46
46
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 ;
47
51
};
48
52
49
53
You can’t perform that action at this time.
0 commit comments