changes
This commit is contained in:
parent
322439692e
commit
ea70f162ad
|
@ -17,6 +17,10 @@
|
||||||
|
|
||||||
#include "xinputsimulator.h"
|
#include "xinputsimulator.h"
|
||||||
|
|
||||||
|
|
||||||
|
//*************************************************//
|
||||||
|
//******************M O U S E**********************//
|
||||||
|
//*************************************************//
|
||||||
void XInputSimulator::mouseMoveTo(int x, int y)
|
void XInputSimulator::mouseMoveTo(int x, int y)
|
||||||
{
|
{
|
||||||
implementation->mouseMoveTo(x, y);
|
implementation->mouseMoveTo(x, y);
|
||||||
|
@ -52,6 +56,10 @@ void XInputSimulator::mouseScrollY(int length)
|
||||||
implementation->mouseScrollY(length);
|
implementation->mouseScrollY(length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//*************************************************//
|
||||||
|
//***************K E Y B O A R D*******************//
|
||||||
|
//*************************************************//
|
||||||
|
|
||||||
void XInputSimulator::keyDown(int key)
|
void XInputSimulator::keyDown(int key)
|
||||||
{
|
{
|
||||||
implementation->keyDown(key);
|
implementation->keyDown(key);
|
||||||
|
@ -62,3 +70,17 @@ void XInputSimulator::keyUp(int key)
|
||||||
implementation->keyUp(key);
|
implementation->keyUp(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void XInputSimulator::keyClick(int key)
|
||||||
|
{
|
||||||
|
implementation->keyClick(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
void XInputSimulator::charToKeyCode(char key_char)
|
||||||
|
{
|
||||||
|
implementation->charToKeyCode(key_char);
|
||||||
|
}
|
||||||
|
|
||||||
|
void XInputSimulator::keySequence(const std::string &sequence)
|
||||||
|
{
|
||||||
|
implementation->keySequence(sequence);
|
||||||
|
}
|
||||||
|
|
|
@ -60,10 +60,6 @@ public:
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const int LEFT_MOUSE_BUTTON = 1;
|
|
||||||
static const int RIGHT_MOUSE_BUTTON = 2;
|
|
||||||
static const int MIDDLE_MOUSE_BUTTON = 3;
|
|
||||||
|
|
||||||
void mouseMoveTo(int x, int y);
|
void mouseMoveTo(int x, int y);
|
||||||
void mouseMoveRelative(int x, int y);
|
void mouseMoveRelative(int x, int y);
|
||||||
void mouseDown(int button);
|
void mouseDown(int button);
|
||||||
|
@ -74,6 +70,15 @@ public:
|
||||||
|
|
||||||
void keyDown(int key);
|
void keyDown(int key);
|
||||||
void keyUp(int key);
|
void keyUp(int key);
|
||||||
|
void keyClick(int key);
|
||||||
|
|
||||||
|
void charToKeyCode(char key_char);
|
||||||
|
void keySequence(const std::string &sequence);
|
||||||
|
|
||||||
|
// mouse
|
||||||
|
static const int LEFT_MOUSE_BUTTON = 1;
|
||||||
|
static const int RIGHT_MOUSE_BUTTON = 2;
|
||||||
|
static const int MIDDLE_MOUSE_BUTTON = 3;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,8 @@
|
||||||
#ifndef XINPUTSIMULATORIMPL_H
|
#ifndef XINPUTSIMULATORIMPL_H
|
||||||
#define XINPUTSIMULATORIMPL_H
|
#define XINPUTSIMULATORIMPL_H
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
class XInputSimulatorImpl
|
class XInputSimulatorImpl
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -32,8 +34,13 @@ public:
|
||||||
virtual void mouseScrollX(int length) = 0;
|
virtual void mouseScrollX(int length) = 0;
|
||||||
virtual void mouseScrollY(int length) = 0;
|
virtual void mouseScrollY(int length) = 0;
|
||||||
|
|
||||||
|
|
||||||
virtual void keyDown(int key) = 0;
|
virtual void keyDown(int key) = 0;
|
||||||
virtual void keyUp(int key) = 0;
|
virtual void keyUp(int key) = 0;
|
||||||
|
virtual void keyClick(int key) = 0;
|
||||||
|
|
||||||
|
virtual void charToKeyCode(char key_char) = 0;
|
||||||
|
virtual void keySequence(const std::string &sequence) = 0;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -149,5 +149,19 @@ void XInputSimulatorImplLinux::keyUp(int key)
|
||||||
throw NotImplementedException();
|
throw NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void XInputSimulatorImplLinux::keyClick(int key)
|
||||||
|
{
|
||||||
|
throw NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
void XInputSimulatorImplLinux::charToKeyCode(char key_char)
|
||||||
|
{
|
||||||
|
throw NotImplementedException();
|
||||||
|
}
|
||||||
|
void XInputSimulatorImplLinux::keySequence(const std::string &sequence)
|
||||||
|
{
|
||||||
|
throw NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // linux
|
#endif // linux
|
||||||
|
|
|
@ -48,6 +48,10 @@ public:
|
||||||
|
|
||||||
virtual void keyDown(int key) override;
|
virtual void keyDown(int key) override;
|
||||||
virtual void keyUp(int key) override;
|
virtual void keyUp(int key) override;
|
||||||
|
virtual void keyClick(int key) override;
|
||||||
|
|
||||||
|
virtual void charToKeyCode(char key_char) override;
|
||||||
|
virtual void keySequence(const std::string &sequence) override;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -187,4 +187,18 @@ void XInputSimulatorImplMacOs::keyUp(int key)
|
||||||
throw NotImplementedException();
|
throw NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void XInputSimulatorImplMacOs::keyClick(int key)
|
||||||
|
{
|
||||||
|
throw NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
void XInputSimulatorImplMacOs::charToKeyCode(char key_char)
|
||||||
|
{
|
||||||
|
throw NotImplementedException();
|
||||||
|
}
|
||||||
|
void XInputSimulatorImplMacOs::keySequence(const std::string &sequence)
|
||||||
|
{
|
||||||
|
throw NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
#endif //apple
|
#endif //apple
|
||||||
|
|
|
@ -45,6 +45,10 @@ public:
|
||||||
|
|
||||||
virtual void keyDown(int key) override;
|
virtual void keyDown(int key) override;
|
||||||
virtual void keyUp(int key) override;
|
virtual void keyUp(int key) override;
|
||||||
|
virtual void keyClick(int key) override;
|
||||||
|
|
||||||
|
virtual void charToKeyCode(char key_char) override;
|
||||||
|
virtual void keySequence(const std::string &sequence) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -144,4 +144,18 @@ void XInputSimulatorImplWin::keyUp(int key)
|
||||||
throw NotImplementedException();
|
throw NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void XInputSimulatorImplWin::keyClick(int key)
|
||||||
|
{
|
||||||
|
throw NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
void XInputSimulatorImplWin::charToKeyCode(char key_char)
|
||||||
|
{
|
||||||
|
throw NotImplementedException();
|
||||||
|
}
|
||||||
|
void XInputSimulatorImplWin::keySequence(const std::string &sequence)
|
||||||
|
{
|
||||||
|
throw NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
#endif //win
|
#endif //win
|
||||||
|
|
|
@ -44,6 +44,10 @@ public:
|
||||||
|
|
||||||
virtual void keyDown(int key) override;
|
virtual void keyDown(int key) override;
|
||||||
virtual void keyUp(int key) override;
|
virtual void keyUp(int key) override;
|
||||||
|
virtual void keyClick(int key) override;
|
||||||
|
|
||||||
|
virtual void charToKeyCode(char key_char) override;
|
||||||
|
virtual void keySequence(const std::string &sequence) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue