GECKO 1.0
Human-computer interface based on hand gesture recognition
|
00001 //------------------------------------------------------------------------------ 00002 //-- mouse 00003 //------------------------------------------------------------------------------ 00004 //-- 00005 //-- Functions to control the mouse under linux 00006 //-- 00007 //------------------------------------------------------------------------------ 00008 //-- 00009 //-- This file belongs to the "Gecko - Gesture Recognition" project 00010 //-- (https://github.com/David-Estevez/gecko) 00011 //-- 00012 //------------------------------------------------------------------------------ 00013 //-- Authors: David Estevez Fernandez 00014 //-- Irene Sanz Nieto 00015 //-- 00016 //-- Released under the GPL license (more info on LICENSE.txt file) 00017 //------------------------------------------------------------------------------ 00018 00027 #ifndef MOUSE_H 00028 #define MOUSE_H 00029 00030 #include <iostream> 00031 #include <cstdlib> 00032 #include <unistd.h> 00033 00034 #include <opencv2/opencv.hpp> 00035 00036 //-- Include libraries to control the mouse in Linux 00037 #include <X11/Xlib.h> 00038 #include <X11/Xutil.h> 00039 #include <X11/Xatom.h> 00040 00049 void moveMouse( std::pair <int, int> coordinates, const bool absoluteMode = true); 00050 00058 void moveMousePercentage( std::pair <double, double> coordinates ); 00059 00060 00062 void click(); 00063 00068 std::pair<int, int> getDisplayDimensions( ); 00069 00074 std::pair<int, int> getMousePos(); 00075 00076 #endif //MOUSE_H