+2002-07-11 Douglas Lowder <dlowder@earthlink.net>
+- Added code in src/ts_read_raw.c to handle reading events from the mk712
+ touchscreen driver on the Hitachi Webpad.
+
+- Fixed a bug in plugins/linear.c (incorrect default calibration in
+ absence of /etc/pointercal)
+
2002-07-10 Douglas Lowder <dlowder@earthlink.net>
- Added a patch by Holger Schurig <h.schurig@mn-logistik.de> to fix
* This file is placed under the LGPL. Please see the file
* COPYING for more details.
*
- * $Id: linear.c,v 1.4 2002/07/01 23:02:57 dlowder Exp $
+ * $Id: linear.c,v 1.5 2002/07/11 18:19:55 dlowder Exp $
*
* Linearly scale touchscreen values
*/
lin->module.ops = &linear_ops;
// Use default values that leave ts numbers unchanged after transform
- lin->a[0] = 0;
- lin->a[1] = 1;
+ lin->a[0] = 1;
+ lin->a[1] = 0;
lin->a[2] = 0;
lin->a[3] = 0;
- lin->a[4] = 0;
- lin->a[5] = 1;
+ lin->a[4] = 1;
+ lin->a[5] = 0;
lin->a[6] = 1;
lin->p_offset = 0;
lin->p_mult = 1;
* This file is placed under the LGPL. Please see the file
* COPYING for more details.
*
- * $Id: ts_read_raw.c,v 1.5 2002/07/10 17:45:45 dlowder Exp $
+ * $Id: ts_read_raw.c,v 1.6 2002/07/11 18:19:55 dlowder Exp $
*
* Read raw pressure, x, y, and timestamp from a touchscreen device.
*/
#ifdef USE_INPUT_API
#include <linux/input.h>
#else
-struct ts_event {
+struct ts_event { /* Used in UCB1x00 style touchscreens (the default) */
unsigned short pressure;
unsigned short x;
unsigned short y;
unsigned short pad;
struct timeval stamp;
};
-struct h3600_ts_event {
+struct h3600_ts_event { /* Used in the Compaq IPAQ */
unsigned short pressure;
unsigned short x;
unsigned short y;
unsigned short pad;
};
-
+struct mk712_ts_event { /* Used in the Hitachi Webpad */
+ unsigned int header;
+ unsigned int x;
+ unsigned int y;
+ unsigned int reserved;
+};
#endif /* USE_INPUT_API */
#include "tslib-private.h"
#else
struct ts_event *evt;
struct h3600_ts_event *hevt;
+ struct mk712_ts_event *mevt;
#endif /* USE_INPUT_API */
int ret;
int total = 0;
ret -= sizeof(*hevt);
}
}
+ } else if( strcmp(tseventtype,"MK712") == 0) { /* Hitachi Webpad events */
+ mevt = alloca(sizeof(*mevt) * nr);
+ ret = read(ts->fd, mevt, sizeof(*mevt) * nr);
+ if(ret >= 0) {
+ int nr = ret / sizeof(*mevt);
+ while(ret >= sizeof(*mevt)) {
+ samp->x = (short)mevt->x;
+ samp->y = (short)mevt->y;
+ if(mevt->header==0)
+ samp->pressure=1;
+ else
+ samp->pressure=0;
+#ifdef DEBUG
+ printf("RAW---------------------------> %d %d %d\n",samp->x,samp->y,samp->pressure);
+#endif /*DEBUG*/
+ gettimeofday(&samp->tv,NULL);
+ samp++;
+ mevt++;
+ ret -= sizeof(*mevt);
+ }
+ }
} else { /* Use normal UCB1x00 type events */
evt = alloca(sizeof(*evt) * nr);
ret = read(ts->fd, evt, sizeof(*evt) * nr);