This commit is contained in:
Dustin Bensing 2013-07-16 19:39:22 +02:00
parent 322439692e
commit ea70f162ad
9 changed files with 92 additions and 4 deletions

View File

@ -17,6 +17,10 @@
#include "xinputsimulator.h"
//*************************************************//
//******************M O U S E**********************//
//*************************************************//
void XInputSimulator::mouseMoveTo(int x, int y)
{
implementation->mouseMoveTo(x, y);
@ -52,6 +56,10 @@ void XInputSimulator::mouseScrollY(int length)
implementation->mouseScrollY(length);
}
//*************************************************//
//***************K E Y B O A R D*******************//
//*************************************************//
void XInputSimulator::keyDown(int key)
{
implementation->keyDown(key);
@ -62,3 +70,17 @@ void XInputSimulator::keyUp(int 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);
}

View File

@ -60,10 +60,6 @@ public:
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 mouseMoveRelative(int x, int y);
void mouseDown(int button);
@ -74,6 +70,15 @@ public:
void keyDown(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;
};

View File

@ -18,6 +18,8 @@
#ifndef XINPUTSIMULATORIMPL_H
#define XINPUTSIMULATORIMPL_H
#include <iostream>
class XInputSimulatorImpl
{
public:
@ -32,8 +34,13 @@ public:
virtual void mouseScrollX(int length) = 0;
virtual void mouseScrollY(int length) = 0;
virtual void keyDown(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;
};

View File

@ -149,5 +149,19 @@ void XInputSimulatorImplLinux::keyUp(int key)
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

View File

@ -48,6 +48,10 @@ public:
virtual void keyDown(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;
};

View File

@ -187,4 +187,18 @@ void XInputSimulatorImplMacOs::keyUp(int key)
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

View File

@ -45,6 +45,10 @@ public:
virtual void keyDown(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;
};

View File

@ -144,4 +144,18 @@ void XInputSimulatorImplWin::keyUp(int key)
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

View File

@ -44,6 +44,10 @@ public:
virtual void keyDown(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;
};