From 80ccdaa7441ab9d729b7736d6a784632e216ba74 Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Wed, 14 Apr 2010 11:23:01 +0200 Subject: 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 --- src/capabilities.c | 4 ++++ src/capabilities.h | 1 + 2 files changed, 5 insertions(+) (limited to 'src') 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); -- cgit v1.2.3