summaryrefslogtreecommitdiff
path: root/src
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 /src
parentcc7c4c6ebfbd35ed16e9da8d5c70431fce9f31cd (diff)
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>
Diffstat (limited to 'src')
-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 @@
48#define MT_TOOL_PEN 1 48#define MT_TOOL_PEN 1
49#endif 49#endif
50 50
51/* includes available in 2.6.33 */
52#ifndef ABS_MT_PRESSURE
53#define ABS_MT_PRESSURE 0x3a /* Pressure on contact area */
54#endif
55
51#define SYSCALL(call) while (((call) == -1) && (errno == EINTR)) 56#define SYSCALL(call) while (((call) == -1) && (errno == EINTR))
52 57
53#define BITMASK(x) (1U << (x)) 58#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)
81 case ABS_MT_ORIENTATION: 81 case ABS_MT_ORIENTATION:
82 hw->finger[hw->nread].orientation = ev->value; 82 hw->finger[hw->nread].orientation = ev->value;
83 break; 83 break;
84 case ABS_MT_PRESSURE:
85 hw->finger[hw->nread].pressure = ev->value;
86 break;
84 case ABS_MT_POSITION_X: 87 case ABS_MT_POSITION_X:
85 hw->finger[hw->nread].position_x = ev->value; 88 hw->finger[hw->nread].position_x = ev->value;
86 break; 89 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 @@
37struct FingerData { 37struct FingerData {
38 int touch_major, touch_minor; 38 int touch_major, touch_minor;
39 int width_major, width_minor; 39 int width_major, width_minor;
40 int orientation; 40 int orientation, pressure;
41 int position_x, position_y; 41 int position_x, position_y;
42}; 42};
43 43
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)
150 s->nfinger); 150 s->nfinger);
151 for (i = 0; i < s->nfinger; i++) { 151 for (i = 0; i < s->nfinger; i++) {
152 xf86Msg(X_INFO, 152 xf86Msg(X_INFO,
153 " %+02d %+05d:%+05d +%05d:%+05d %+06d %+05d:%+05d\n", 153 " %+02d %+05d:%+05d +%05d:%+05d "
154 "%+06d %+06d %+05d:%+05d\n",
154 s->finger[i].id, 155 s->finger[i].id,
155 s->finger[i].hw.touch_major, 156 s->finger[i].hw.touch_major,
156 s->finger[i].hw.touch_minor, 157 s->finger[i].hw.touch_minor,
157 s->finger[i].hw.width_major, 158 s->finger[i].hw.width_major,
158 s->finger[i].hw.width_minor, 159 s->finger[i].hw.width_minor,
159 s->finger[i].hw.orientation, 160 s->finger[i].hw.orientation,
161 s->finger[i].hw.pressure,
160 s->finger[i].hw.position_x, 162 s->finger[i].hw.position_x,
161 s->finger[i].hw.position_y); 163 s->finger[i].hw.position_y);
162 } 164 }