summaryrefslogtreecommitdiff
path: root/synclient.c
blob: 89e6defa7adb71dd787c8cc4ad2a65c9e9268129 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <stdio.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <unistd.h>
#define SHM_SYNAPTICS 23947
typedef struct _SynapticsSHM {
	int x, y;
} SynapticsSHM;

int main() {
	SynapticsSHM *synshm;
	int shmid;

	if((shmid = shmget(SHM_SYNAPTICS, 0, 0)) == -1) 
		printf("shmget Fehler\n");
	if((synshm = (SynapticsSHM*) shmat(shmid, NULL, 0)) == NULL)
		printf("shmat Fehler\n");

	while(1) {
		printf("x:%d y:%d\n", synshm->x, synshm->y);
		usleep(100000);
	}	

	exit(0);
}