summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2010-04-14 11:23:01 +0200
committerHenrik Rydberg <rydberg@euromail.se>2010-04-15 06:10:08 +0200
commit80ccdaa7441ab9d729b7736d6a784632e216ba74 (patch)
tree2b1f0d411503815e6f88311d41d278af1a269c0b /src
parent872fccb2f4214b99b82e74a8b9e90c9c5f0773c1 (diff)
Add constant clicking area to capabilities
The trackpads with integrated button have a dedicated clicking area at the bottom of the pad. This patch adds the position of the onset of the clicking area to capabilities. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'src')
-rw-r--r--src/capabilities.c4
-rw-r--r--src/capabilities.h1
2 files changed, 5 insertions, 0 deletions
diff --git a/src/capabilities.c b/src/capabilities.c
index 065c810..1f555f9 100644
--- a/src/capabilities.c
+++ b/src/capabilities.c
@@ -26,6 +26,8 @@
#define ADDCAP(s, c, x) strcat(s, c->has_##x ? " " #x : "")
+#define CLICK_AREA(c) ((c->has_ibt ? 0.20 : 0.00) * get_cap_ysize(c))
+
static const int SN_COORD = 250; /* coordinate signal-to-noise ratio */
static const int bits_per_long = 8 * sizeof(long);
@@ -102,6 +104,8 @@ int read_capabilities(struct Capabilities *cap, int fd)
cap->yfuzz = get_cap_ysize(cap) / SN_COORD;
}
+ cap->yclick = cap->abs_position_y.maximum - CLICK_AREA(cap);
+
return 0;
}
diff --git a/src/capabilities.h b/src/capabilities.h
index 34c1767..af59384 100644
--- a/src/capabilities.h
+++ b/src/capabilities.h
@@ -41,6 +41,7 @@ struct Capabilities {
struct input_absinfo abs_position_x;
struct input_absinfo abs_position_y;
int xfuzz, yfuzz;
+ int yclick;
};
int read_capabilities(struct Capabilities *cap, int fd);