aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2010-03-21 14:57:42 +0100
committerHenrik Rydberg <rydberg@euromail.se>2010-03-21 14:57:42 +0100
commitd5b3178ca184dee4b3116e5b569745d43dbe37ef (patch)
treebc0cef4cb7d59398074675e28089c6a9a775e6fb
parentcc7c4c6ebfbd35ed16e9da8d5c70431fce9f31cd (diff)
downloadxorg-input-kobomultitouch-d5b3178ca184dee4b3116e5b569745d43dbe37ef.tar.gz
xorg-input-kobomultitouch-d5b3178ca184dee4b3116e5b569745d43dbe37ef.tar.bz2
xorg-input-kobomultitouch-d5b3178ca184dee4b3116e5b569745d43dbe37ef.zip
Add support for the ABS_MT_PRESSURE event
The kernel MT api was recently updated to include the ABS_MT_PRESSURE event. This patch adds it to the hardware structure. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
-rw-r--r--src/common.h5
-rw-r--r--src/hwdata.c3
-rw-r--r--src/hwdata.h2
-rw-r--r--src/state.c4
4 files changed, 12 insertions, 2 deletions
diff --git a/src/common.h b/src/common.h
index f64e114..27082b7 100644
--- a/src/common.h
+++ b/src/common.h
@@ -48,6 +48,11 @@
#define MT_TOOL_PEN 1
#endif
+/* includes available in 2.6.33 */
+#ifndef ABS_MT_PRESSURE
+#define ABS_MT_PRESSURE 0x3a /* Pressure on contact area */
+#endif
+
#define SYSCALL(call) while (((call) == -1) && (errno == EINTR))
#define BITMASK(x) (1U << (x))
diff --git a/src/hwdata.c b/src/hwdata.c
index bd42710..9e384dc 100644
--- a/src/hwdata.c
+++ b/src/hwdata.c
@@ -81,6 +81,9 @@ int read_hwdata(struct HWData *hw, const struct input_event* ev)
case ABS_MT_ORIENTATION:
hw->finger[hw->nread].orientation = ev->value;
break;
+ case ABS_MT_PRESSURE:
+ hw->finger[hw->nread].pressure = ev->value;
+ break;
case ABS_MT_POSITION_X:
hw->finger[hw->nread].position_x = ev->value;
break;
diff --git a/src/hwdata.h b/src/hwdata.h
index 9b46073..38ffc6b 100644
--- a/src/hwdata.h
+++ b/src/hwdata.h
@@ -37,7 +37,7 @@
struct FingerData {
int touch_major, touch_minor;
int width_major, width_minor;
- int orientation;
+ int orientation, pressure;
int position_x, position_y;
};
diff --git a/src/state.c b/src/state.c
index 895d096..774828a 100644
--- a/src/state.c
+++ b/src/state.c
@@ -150,13 +150,15 @@ void output_state(const struct State *s)
s->nfinger);
for (i = 0; i < s->nfinger; i++) {
xf86Msg(X_INFO,
- " %+02d %+05d:%+05d +%05d:%+05d %+06d %+05d:%+05d\n",
+ " %+02d %+05d:%+05d +%05d:%+05d "
+ "%+06d %+06d %+05d:%+05d\n",
s->finger[i].id,
s->finger[i].hw.touch_major,
s->finger[i].hw.touch_minor,
s->finger[i].hw.width_major,
s->finger[i].hw.width_minor,
s->finger[i].hw.orientation,
+ s->finger[i].hw.pressure,
s->finger[i].hw.position_x,
s->finger[i].hw.position_y);
}