Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 215562
b: refs/heads/master
c: 48216fb
h: refs/heads/master
v: v3
  • Loading branch information
Henrik Rydberg authored and Jiri Kosina committed Sep 22, 2010
1 parent 3fdcbbc commit a4df605
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1d958c83c8d77ad4977ae963017e87cec8cca9b5
refs/heads/master: 48216fbdad6cc462b056ce1e876edcc664d32a8d
10 changes: 6 additions & 4 deletions trunk/drivers/hid/hid-3m-pct.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,16 +166,18 @@ static void mmm_filter_event(struct mmm_data *md, struct input_dev *input)
if (f->touch) {
/* this finger is on the screen */
int wide = (f->w > f->h);
/* divided by two to match visual scale of touch */
int major = max(f->w, f->h) >> 1;
int minor = min(f->w, f->h) >> 1;

if (!f->prev_touch)
f->id = md->id++;
input_event(input, EV_ABS, ABS_MT_TRACKING_ID, f->id);
input_event(input, EV_ABS, ABS_MT_POSITION_X, f->x);
input_event(input, EV_ABS, ABS_MT_POSITION_Y, f->y);
input_event(input, EV_ABS, ABS_MT_ORIENTATION, wide);
input_event(input, EV_ABS, ABS_MT_TOUCH_MAJOR,
wide ? f->w : f->h);
input_event(input, EV_ABS, ABS_MT_TOUCH_MINOR,
wide ? f->h : f->w);
input_event(input, EV_ABS, ABS_MT_TOUCH_MAJOR, major);
input_event(input, EV_ABS, ABS_MT_TOUCH_MINOR, minor);
/* touchscreen emulation: pick the oldest contact */
if (!oldest || ((f->id - oldest->id) & (SHRT_MAX + 1)))
oldest = f;
Expand Down

0 comments on commit a4df605

Please sign in to comment.