diff options
| author | Henrik Rydberg <rydberg@euromail.se> | 2010-08-30 12:31:20 +0200 |
|---|---|---|
| committer | Henrik Rydberg <rydberg@euromail.se> | 2010-08-30 12:31:20 +0200 |
| commit | beab739a36435048626c69861b3ad144bce23d5b (patch) | |
| tree | 2d54e54b1f24f5b062240fbbc3b5d1955109846f /usr/src | |
| parent | b2dede96923654de8dfc41413e0f2fceda131efa (diff) | |
Adjust major / minor axes to scale
Adjust reported major/minor axis to better match visual size.
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'usr/src')
| -rw-r--r-- | usr/src/dkms_source_tree/dkms.conf | 2 | ||||
| -rw-r--r-- | usr/src/dkms_source_tree/hid-3m-pct.c | 10 |
2 files changed, 7 insertions, 5 deletions
diff --git a/usr/src/dkms_source_tree/dkms.conf b/usr/src/dkms_source_tree/dkms.conf index 7674f6a..beb43ec 100644 --- a/usr/src/dkms_source_tree/dkms.conf +++ b/usr/src/dkms_source_tree/dkms.conf | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | NAME=hid-3m-pct | 1 | NAME=hid-3m-pct |
| 2 | VERSION=1.0.1 | 2 | VERSION=1.0.2 |
| 3 | PACKAGE_NAME="$NAME" | 3 | PACKAGE_NAME="$NAME" |
| 4 | PACKAGE_VERSION="$VERSION" | 4 | PACKAGE_VERSION="$VERSION" |
| 5 | MAKE[0]="make -C ${kernel_source_dir} | 5 | MAKE[0]="make -C ${kernel_source_dir} |
diff --git a/usr/src/dkms_source_tree/hid-3m-pct.c b/usr/src/dkms_source_tree/hid-3m-pct.c index 65441e0..cd4b125 100644 --- a/usr/src/dkms_source_tree/hid-3m-pct.c +++ b/usr/src/dkms_source_tree/hid-3m-pct.c | |||
| @@ -162,16 +162,18 @@ static void mmm_filter_event(struct mmm_data *md, struct input_dev *input) | |||
| 162 | if (f->touch) { | 162 | if (f->touch) { |
| 163 | /* this finger is on the screen */ | 163 | /* this finger is on the screen */ |
| 164 | int wide = (f->w > f->h); | 164 | int wide = (f->w > f->h); |
| 165 | /* divided by two to match visual scale of touch */ | ||
| 166 | int major = max(f->w, f->h) >> 1; | ||
| 167 | int minor = min(f->w, f->h) >> 1; | ||
| 168 | |||
| 165 | if (!f->prev_touch) | 169 | if (!f->prev_touch) |
| 166 | f->id = md->id++; | 170 | f->id = md->id++; |
| 167 | input_event(input, EV_ABS, ABS_MT_TRACKING_ID, f->id); | 171 | input_event(input, EV_ABS, ABS_MT_TRACKING_ID, f->id); |
| 168 | input_event(input, EV_ABS, ABS_MT_POSITION_X, f->x); | 172 | input_event(input, EV_ABS, ABS_MT_POSITION_X, f->x); |
| 169 | input_event(input, EV_ABS, ABS_MT_POSITION_Y, f->y); | 173 | input_event(input, EV_ABS, ABS_MT_POSITION_Y, f->y); |
| 170 | input_event(input, EV_ABS, ABS_MT_ORIENTATION, wide); | 174 | input_event(input, EV_ABS, ABS_MT_ORIENTATION, wide); |
| 171 | input_event(input, EV_ABS, ABS_MT_TOUCH_MAJOR, | 175 | input_event(input, EV_ABS, ABS_MT_TOUCH_MAJOR, major); |
| 172 | wide ? f->w : f->h); | 176 | input_event(input, EV_ABS, ABS_MT_TOUCH_MINOR, minor); |
| 173 | input_event(input, EV_ABS, ABS_MT_TOUCH_MINOR, | ||
| 174 | wide ? f->h : f->w); | ||
| 175 | /* touchscreen emulation: pick the oldest contact */ | 177 | /* touchscreen emulation: pick the oldest contact */ |
| 176 | if (!oldest || ((f->id - oldest->id) & (SHRT_MAX + 1))) | 178 | if (!oldest || ((f->id - oldest->id) & (SHRT_MAX + 1))) |
| 177 | oldest = f; | 179 | oldest = f; |
