Created
July 13, 2012 10:59
-
-
Save xlab/3104270 to your computer and use it in GitHub Desktop.
Touchscreen lock via tslib
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "tslib/src/tslib.h" | |
struct tsdev *ts; | |
char *tsdevice = "/dev/input/event0"; | |
ts = ts_open(tsdevice, 0); | |
int ts_tmpfd = ts_fd(ts); | |
if (ts_tmpfd == -1) | |
{ | |
perror("ts_open"); | |
exit(1); | |
} | |
unsigned long val = 1; | |
int ioctl_ret = ioctl(ts_tmpfd, EVIOCGRAB, &val); | |
printf("now lock the ts ioctl ret is: %d\n", ioctl_ret); | |
if (ioctl_ret != 0) | |
{ | |
printf("Error: %s\n", strerror(errno)); | |
exit(1); | |
} | |
printf("lock the ts succeed\n"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment