Skip to content

Instantly share code, notes, and snippets.

@kashimAstro
Last active November 14, 2016 23:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kashimAstro/3f5b672ce61625149e4a9855e0cd0182 to your computer and use it in GitHub Desktop.
Save kashimAstro/3f5b672ce61625149e4a9855e0cd0182 to your computer and use it in GitHub Desktop.
#include "ofMain.h"
#include <X11/X.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include "ofxTFTTouch.h"
Display *display;
Window root;
ofxTFTTouch touch;
int w,h;
void setup(){
w=ofGetScreenWidth();
h=ofGetScreenHeight();
touch.init("/dev/input/event0",w,h);
ofLog()<<touch.getName();
}
void exit(){
touch.exit();
}
void update(){
if(touch.getCoordTouch().z!=0)
{
if ((display = XOpenDisplay(NULL)) == NULL)
{
ofLog()<<"Cannot open local X-display";
}
root = DefaultRootWindow(display);
XWarpPointer(display, None, None, 0, 0, 0, 0,touch.getCoordTouch().x,touch.getCoordTouch().y);
XCloseDisplay(display);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment