summaryrefslogtreecommitdiff
path: root/src/multitouch.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/multitouch.c')
-rw-r--r--src/multitouch.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/multitouch.c b/src/multitouch.c
index 6281a5b..3dde667 100644
--- a/src/multitouch.c
+++ b/src/multitouch.c
@@ -32,6 +32,7 @@ static const float hscroll_fraction = 0.05;
32static const float vswipe_fraction = 0.25; 32static const float vswipe_fraction = 0.25;
33static const float hswipe_fraction = 0.25; 33static const float hswipe_fraction = 0.25;
34static const float scale_fraction = 0.05; 34static const float scale_fraction = 0.05;
35static const float rot_fraction = 0.05;
35 36
36/* flip these to enable event debugging */ 37/* flip these to enable event debugging */
37#if 1 38#if 1
@@ -85,6 +86,8 @@ static void initButtonLabels(Atom map[DIM_BUTTON])
85 /* how to map scale and rotate? */ 86 /* how to map scale and rotate? */
86 PROPMAP(map, MT_BUTTON_SCALE_DOWN, BTN_LABEL_PROP_BTN_4); 87 PROPMAP(map, MT_BUTTON_SCALE_DOWN, BTN_LABEL_PROP_BTN_4);
87 PROPMAP(map, MT_BUTTON_SCALE_UP, BTN_LABEL_PROP_BTN_5); 88 PROPMAP(map, MT_BUTTON_SCALE_UP, BTN_LABEL_PROP_BTN_5);
89 PROPMAP(map, MT_BUTTON_ROTATE_LEFT, BTN_LABEL_PROP_BTN_6);
90 PROPMAP(map, MT_BUTTON_ROTATE_RIGHT, BTN_LABEL_PROP_BTN_7);
88} 91}
89#endif 92#endif
90 93
@@ -92,7 +95,7 @@ static int device_init(DeviceIntPtr dev, LocalDevicePtr local)
92{ 95{
93 struct MTouch *mt = local->private; 96 struct MTouch *mt = local->private;
94 unsigned char btmap[DIM_BUTTON + 1] = { 97 unsigned char btmap[DIM_BUTTON + 1] = {
95 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 98 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
96 }; 99 };
97#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 100#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
98 Atom axes_labels[2], btn_labels[DIM_BUTTON]; 101 Atom axes_labels[2], btn_labels[DIM_BUTTON];
@@ -213,12 +216,13 @@ static void handle_gestures(LocalDevicePtr local,
213 const struct Gestures *gs, 216 const struct Gestures *gs,
214 const struct Capabilities *caps) 217 const struct Capabilities *caps)
215{ 218{
216 static int vscroll, hscroll, vswipe, hswipe, scale; 219 static int vscroll, hscroll, vswipe, hswipe, scale, rot;
217 int vscrollstep = 1 + vscroll_fraction * get_cap_ysize(caps); 220 int vscrollstep = 1 + vscroll_fraction * get_cap_ysize(caps);
218 int hscrollstep = 1 + hscroll_fraction * get_cap_xsize(caps); 221 int hscrollstep = 1 + hscroll_fraction * get_cap_xsize(caps);
219 int vswipestep = 1 + vswipe_fraction * get_cap_ysize(caps); 222 int vswipestep = 1 + vswipe_fraction * get_cap_ysize(caps);
220 int hswipestep = 1 + hswipe_fraction * get_cap_xsize(caps); 223 int hswipestep = 1 + hswipe_fraction * get_cap_xsize(caps);
221 int scalestep = 1 + scale_fraction * get_cap_xsize(caps); 224 int scalestep = 1 + scale_fraction * get_cap_xsize(caps);
225 int rotstep = 1 + rot_fraction * get_cap_xsize(caps);
222 int i; 226 int i;
223 if (!gs->same_fingers) { 227 if (!gs->same_fingers) {
224 vscroll = 0; 228 vscroll = 0;
@@ -258,6 +262,10 @@ static void handle_gestures(LocalDevicePtr local,
258 button_scroll(local, 12, 13, &scale, scalestep, gs->scale); 262 button_scroll(local, 12, 13, &scale, scalestep, gs->scale);
259 TRACE1("scale: %d\n", gs->scale); 263 TRACE1("scale: %d\n", gs->scale);
260 } 264 }
265 if (GETBIT(gs->type, GS_ROTATE)) {
266 button_scroll(local, 14, 15, &rot, rotstep, gs->rot);
267 TRACE1("rotate: %d\n", gs->rot);
268 }
261} 269}
262 270
263/* called for each full received packet from the touchpad */ 271/* called for each full received packet from the touchpad */