diff options
| author | Henrik Rydberg <rydberg@euromail.se> | 2010-04-14 11:23:01 +0200 |
|---|---|---|
| committer | Henrik Rydberg <rydberg@euromail.se> | 2010-04-15 06:10:08 +0200 |
| commit | 80ccdaa7441ab9d729b7736d6a784632e216ba74 (patch) | |
| tree | 2b1f0d411503815e6f88311d41d278af1a269c0b /src/capabilities.c | |
| parent | 872fccb2f4214b99b82e74a8b9e90c9c5f0773c1 (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/capabilities.c')
| -rw-r--r-- | src/capabilities.c | 4 |
1 files changed, 4 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 @@ | |||
| 26 | 26 | ||
| 27 | #define ADDCAP(s, c, x) strcat(s, c->has_##x ? " " #x : "") | 27 | #define ADDCAP(s, c, x) strcat(s, c->has_##x ? " " #x : "") |
| 28 | 28 | ||
| 29 | #define CLICK_AREA(c) ((c->has_ibt ? 0.20 : 0.00) * get_cap_ysize(c)) | ||
| 30 | |||
| 29 | static const int SN_COORD = 250; /* coordinate signal-to-noise ratio */ | 31 | static const int SN_COORD = 250; /* coordinate signal-to-noise ratio */ |
| 30 | 32 | ||
| 31 | static const int bits_per_long = 8 * sizeof(long); | 33 | static const int bits_per_long = 8 * sizeof(long); |
| @@ -102,6 +104,8 @@ int read_capabilities(struct Capabilities *cap, int fd) | |||
| 102 | cap->yfuzz = get_cap_ysize(cap) / SN_COORD; | 104 | cap->yfuzz = get_cap_ysize(cap) / SN_COORD; |
| 103 | } | 105 | } |
| 104 | 106 | ||
| 107 | cap->yclick = cap->abs_position_y.maximum - CLICK_AREA(cap); | ||
| 108 | |||
| 105 | return 0; | 109 | return 0; |
| 106 | } | 110 | } |
| 107 | 111 | ||
