XInputSimulator/XInputSimulator/xinputsimulator.h

72 lines
1.8 KiB
C
Raw Normal View History

2013-07-14 14:25:29 +02:00
// Copyright 2013 Dustin Bensing
// This file is part of XInputSimulator.
// XInputSimulator is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser Public License as published by
// the Free Software Foundation, either version 3 of the License, or
2013-07-14 14:28:53 +02:00
// any later version.
2013-07-14 14:25:29 +02:00
// XInputSimulator is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser Public License for more details.
// You should have received a copy of the GNU Lesser Public License
// along with XInputSimulator. If not, see <http://www.gnu.org/licenses/>.
2013-07-14 13:52:02 +02:00
#ifndef XINPUTSIMULATOR_H
#define XINPUTSIMULATOR_H
#include <memory>
#include <iostream>
#include <stdexcept>
2013-07-14 13:52:02 +02:00
class XInputSimulator
{
private:
class XInputSimulatorImpl *implementation;
2013-07-14 13:52:02 +02:00
XInputSimulator(){}
public:
XInputSimulator(XInputSimulator&) = delete;
void operator=(XInputSimulator&) = delete;
~XInputSimulator();
2013-07-14 13:52:02 +02:00
static XInputSimulator & getInstance();
2013-07-14 13:52:02 +02:00
2013-07-16 17:58:24 +02:00
void mouseMoveTo(int x, int y);
2013-07-14 13:52:02 +02:00
void mouseMoveRelative(int x, int y);
void mouseDown(int button);
void mouseUp(int button);
void mouseClick(int button);
void mouseScrollX(int length);
void mouseScrollY(int length);
void keyDown(int key);
void keyUp(int key);
2013-07-16 19:39:22 +02:00
void keyClick(int key);
2013-07-16 23:08:00 +02:00
int charToKeyCode(char key_char);
2013-07-16 19:39:22 +02:00
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;
2013-07-14 13:52:02 +02:00
};
typedef XInputSimulator XIS;
2013-07-14 13:52:02 +02:00
class NotImplementedException : public std::runtime_error
{
public:
NotImplementedException();
};
2013-07-14 13:52:02 +02:00
#endif // XINPUTSIMULATOR_H