* Added z, w, left, right, up and down information to the shared memory

area. Updated synclient to report the new information.
* Improved synclient to only report when something changes.
This commit is contained in:
Peter Osterlund
2002-07-04 01:00:27 +02:00
parent a37bd61dc4
commit 5a5fd8052a
3 changed files with 33 additions and 2 deletions

View File

@@ -488,6 +488,12 @@ ReadInput(LocalDevicePtr local)
/* shared memory */
para->x = x;
para->y = y;
para->z = z;
para->w = w;
para->left = left;
para->right = right;
para->up = up;
para->down = down;
/* 3rd button emulation */
if(!left && !right) {

View File

@@ -19,6 +19,9 @@ typedef struct _SynapticsMoveHist {
typedef struct _SynapticsSHM {
int x, y; /* actual x, y Coordinates */
int z; /* pressure value */
int w; /* finger width value */
int left, right, up, down; /* left/right/up/down buttons */
unsigned long int model_id; /* Model-ID */
unsigned long int capabilities; /* Capabilities */

View File

@@ -3,14 +3,31 @@
#include <sys/ipc.h>
#include <sys/shm.h>
#include <unistd.h>
#define SHM_SYNAPTICS 23947
typedef struct _SynapticsSHM {
int x, y;
int z; /* pressure value */
int w; /* finger width value */
int left, right, up, down; /* left/right/up/down buttons */
} SynapticsSHM;
static int is_equal(SynapticsSHM* s1, SynapticsSHM* s2)
{
return ((s1->x == s2->x) &&
(s1->y == s2->y) &&
(s1->z == s2->z) &&
(s1->w == s2->w) &&
(s1->left == s2->left) &&
(s1->right == s2->right) &&
(s1->up == s2->up) &&
(s1->down == s2->down));
}
int main() {
SynapticsSHM *synshm;
int shmid;
SynapticsSHM old;
if((shmid = shmget(SHM_SYNAPTICS, 0, 0)) == -1)
printf("shmget Fehler\n");
@@ -18,9 +35,14 @@ int main() {
printf("shmat Fehler\n");
while(1) {
printf("x:%d y:%d\n", synshm->x, synshm->y);
SynapticsSHM cur = *synshm;
if (!is_equal(&old, &cur)) {
printf("x:%4d y:%4d z:%3d w:%2d left:%d right:%d up:%d down:%d\n",
cur.x, cur.y, cur.z, cur.w, cur.left, cur.right, cur.up, cur.down);
old = cur;
}
usleep(100000);
}
}
exit(0);
}