Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#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
You can’t perform that action at this time.