diff options
Diffstat (limited to 'src/frame-mtdev.c')
| -rw-r--r-- | src/frame-mtdev.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/frame-mtdev.c b/src/frame-mtdev.c index 9192510..caf90ae 100644 --- a/src/frame-mtdev.c +++ b/src/frame-mtdev.c | |||
| @@ -104,12 +104,12 @@ int utouch_frame_init_mtdev(utouch_frame_handle fh, | |||
| 104 | } | 104 | } |
| 105 | 105 | ||
| 106 | s->max_pressure = evemu_get_abs_maximum(dev, ABS_MT_PRESSURE); | 106 | s->max_pressure = evemu_get_abs_maximum(dev, ABS_MT_PRESSURE); |
| 107 | if (s->use_pressure && s->max_pressure == 0) | 107 | if (s->max_pressure == 0) |
| 108 | s->max_pressure = 256; | 108 | s->max_pressure = 256; |
| 109 | 109 | ||
| 110 | fh->max_orient = evemu_get_abs_maximum(dev, ABS_MT_ORIENTATION); | 110 | s->max_orient = evemu_get_abs_maximum(dev, ABS_MT_ORIENTATION); |
| 111 | if (s->use_orientation && fh->max_orient == 0) | 111 | if (s->max_orient == 0) |
| 112 | fh->max_orient = 1; | 112 | s->max_orient = 1; |
| 113 | 113 | ||
| 114 | tmp = evemu_get_abs_resolution(dev, ABS_MT_POSITION_X); | 114 | tmp = evemu_get_abs_resolution(dev, ABS_MT_POSITION_X); |
| 115 | if (tmp > 0) | 115 | if (tmp > 0) |
| @@ -133,12 +133,14 @@ int utouch_frame_init_mtdev(utouch_frame_handle fh, | |||
| 133 | else | 133 | else |
| 134 | s->phys_pressure = 10; | 134 | s->phys_pressure = 10; |
| 135 | 135 | ||
| 136 | return 0; | 136 | /* defaults expected by initial frame version */ |
| 137 | } | 137 | s->mapped_min_x = s->min_x; |
| 138 | s->mapped_min_y = s->min_y; | ||
| 139 | s->mapped_max_x = s->max_x; | ||
| 140 | s->mapped_max_y = s->max_y; | ||
| 141 | s->mapped_max_pressure = s->max_pressure; | ||
| 138 | 142 | ||
| 139 | static float touch_angle(utouch_frame_handle fh, int orient) | 143 | return 0; |
| 140 | { | ||
| 141 | return orient / fh->max_orient * M_PI_2; | ||
| 142 | } | 144 | } |
| 143 | 145 | ||
| 144 | static int handle_abs_event(utouch_frame_handle fh, | 146 | static int handle_abs_event(utouch_frame_handle fh, |
| @@ -169,7 +171,7 @@ static int handle_abs_event(utouch_frame_handle fh, | |||
| 169 | t->width_minor = ev->value; | 171 | t->width_minor = ev->value; |
| 170 | return 1; | 172 | return 1; |
| 171 | case ABS_MT_ORIENTATION: | 173 | case ABS_MT_ORIENTATION: |
| 172 | t->orientation = touch_angle(fh, ev->value); | 174 | t->orientation = ev->value; |
| 173 | return 1; | 175 | return 1; |
| 174 | case ABS_MT_PRESSURE: | 176 | case ABS_MT_PRESSURE: |
| 175 | t->pressure = ev->value; | 177 | t->pressure = ev->value; |
