XInputSimulator/README.md

53 lines
1.8 KiB
Markdown
Raw Permalink Normal View History

2013-07-14 10:45:01 +02:00
XInputSimulator
===============
2013-07-14 17:15:14 +02:00
Cross (X) Plattform (Linux/Mac/Win) Simulator for input devices to simulate mouse moves/clicks/scrolls or keyboard keystrokes.
2015-02-15 21:07:25 +01:00
[![Build Status](https://travis-ci.org/pythoneer/XInputSimulator.svg?branch=master)](https://travis-ci.org/pythoneer/XInputSimulator)
2013-07-14 17:15:14 +02:00
This program is published under the terms of the LGPL (http://www.gnu.org/licenses/)
2013-07-14 14:40:09 +02:00
####How to use
2013-07-14 14:35:32 +02:00
For a detailed example see main.cpp
2013-07-14 14:40:09 +02:00
```cpp
2013-07-14 17:16:24 +02:00
XInputSimulator &sim = XInputSimulator::getInstance();
2013-07-16 17:59:38 +02:00
sim.mouseMoveTo(500,400); //set mouse to screen cords 500x400
sim.mouseMoveRelative(400, -100); //move frome there 400px in x to the right and -100px in y upwards
sim.mouseDown(XInputSimulator::LEFT_MOUSE_BUTTON); //press left mouse and hold
sim.mouseMoveRelative(0, 300); //drag/mark with pressed mousebutton 300px down
sim.mouseUp(XInputSimulator::LEFT_MOUSE_BUTTON); //release the mousebutton press
2013-07-14 14:40:09 +02:00
```
2013-07-16 11:00:43 +02:00
2015-02-20 21:49:24 +01:00
building for Linux use -lX11 -lXtst
building for Mac use -framework ApplicationServices Carbon CoreFoundation
building for Win use User32.lib
2013-07-14 17:11:48 +02:00
2015-02-20 21:24:55 +01:00
for cmake there is a CMakeLists.txt file -simply type (for all platforms):
2015-02-15 21:07:25 +01:00
```
>$ mkdir build
>$ cd build
>$ cmake ../XInputSimulator/
2015-02-20 21:24:55 +01:00
>$ cmake --build .
2015-02-15 21:07:25 +01:00
```
for xcode you can generate a project by
```
>$ mkdir build
>$ cd build
>$ cmake -G Xcode ../XInputSimulator/
```
2013-07-16 14:08:56 +02:00
2013-07-16 14:16:27 +02:00
####Status early Alpha
2013-07-16 13:47:59 +02:00
2013-07-16: Linux, Mac and Win part with following functions
2013-07-14 17:11:48 +02:00
```cpp
mouseMoveTo
mouseMoveRelative
mouseDown
mouseUp
mouseClick
2013-07-14 17:58:44 +02:00
mouseScrollY //up and down
mouseScrollX //left an right
2013-07-14 17:11:48 +02:00
```
2013-07-16 14:16:27 +02:00
2013-07-16 17:53:21 +02:00
be aware that some glitches might appear and the interface might be changing every minute due to the early state of development. There is not much testing going on apart from the main.cpp. Feel free to file bugreports, wishes or patches :)