summaryrefslogtreecommitdiff
path: root/src/lib/elput
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2017-05-26 16:34:10 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2017-05-26 16:27:42 -0400
commitba1ab3a8b1b79b65c03c7c94e731a4396d9ebbf2 (patch)
tree97702e3b7ddd16e9454fe8c8772bee83863ab788 /src/lib/elput
parent679872a8007f512be1882b0de7a733b34968cfbf (diff)
elput: store device pressure for use in events
Diffstat (limited to 'src/lib/elput')
-rw-r--r--src/lib/elput/elput_evdev.c10
-rw-r--r--src/lib/elput/elput_private.h2
2 files changed, 8 insertions, 4 deletions
diff --git a/src/lib/elput/elput_evdev.c b/src/lib/elput/elput_evdev.c
index 16157440ae..94de728e2d 100644
--- a/src/lib/elput/elput_evdev.c
+++ b/src/lib/elput/elput_evdev.c
@@ -547,6 +547,7 @@ _pointer_init(Elput_Seat *seat)
547 547
548 seat->ptr = ptr; 548 seat->ptr = ptr;
549 seat->count.ptr = 1; 549 seat->count.ptr = 1;
550 ptr->pressure = 1.0;
550 551
551 _seat_caps_update(seat); 552 _seat_caps_update(seat);
552 553
@@ -573,6 +574,7 @@ _touch_create(Elput_Seat *seat)
573 if (!touch) return NULL; 574 if (!touch) return NULL;
574 575
575 touch->seat = seat; 576 touch->seat = seat;
577 touch->pressure = 1.0;
576 578
577 return touch; 579 return touch;
578} 580}
@@ -665,7 +667,7 @@ _pointer_motion_send(Elput_Device *edev)
665 ev->multi.radius = 1; 667 ev->multi.radius = 1;
666 ev->multi.radius_x = 1; 668 ev->multi.radius_x = 1;
667 ev->multi.radius_y = 1; 669 ev->multi.radius_y = 1;
668 ev->multi.pressure = 1.0; 670 ev->multi.pressure = ptr->pressure;
669 ev->multi.angle = 0.0; 671 ev->multi.angle = 0.0;
670 ev->multi.x = ev->x; 672 ev->multi.x = ev->x;
671 ev->multi.y = ev->y; 673 ev->multi.y = ev->y;
@@ -768,7 +770,7 @@ _pointer_button_send(Elput_Device *edev, enum libinput_button_state state)
768 ev->multi.radius = 1; 770 ev->multi.radius = 1;
769 ev->multi.radius_x = 1; 771 ev->multi.radius_x = 1;
770 ev->multi.radius_y = 1; 772 ev->multi.radius_y = 1;
771 ev->multi.pressure = 1.0; 773 ev->multi.pressure = ptr->pressure;
772 ev->multi.angle = 0.0; 774 ev->multi.angle = 0.0;
773 ev->multi.x = ev->x; 775 ev->multi.x = ev->x;
774 ev->multi.y = ev->y; 776 ev->multi.y = ev->y;
@@ -995,7 +997,7 @@ _touch_event_send(Elput_Device *dev, int type)
995 ev->multi.radius = 1; 997 ev->multi.radius = 1;
996 ev->multi.radius_x = 1; 998 ev->multi.radius_x = 1;
997 ev->multi.radius_y = 1; 999 ev->multi.radius_y = 1;
998 ev->multi.pressure = 1.0; 1000 ev->multi.pressure = touch->pressure;
999 ev->multi.angle = 0.0; 1001 ev->multi.angle = 0.0;
1000 ev->multi.x = ev->x; 1002 ev->multi.x = ev->x;
1001 ev->multi.y = ev->y; 1003 ev->multi.y = ev->y;
@@ -1043,7 +1045,7 @@ _touch_motion_send(Elput_Device *dev)
1043 ev->multi.radius = 1; 1045 ev->multi.radius = 1;
1044 ev->multi.radius_x = 1; 1046 ev->multi.radius_x = 1;
1045 ev->multi.radius_y = 1; 1047 ev->multi.radius_y = 1;
1046 ev->multi.pressure = 1.0; 1048 ev->multi.pressure = touch->pressure;
1047 ev->multi.angle = 0.0; 1049 ev->multi.angle = 0.0;
1048 ev->multi.x = ev->x; 1050 ev->multi.x = ev->x;
1049 ev->multi.y = ev->y; 1051 ev->multi.y = ev->y;
diff --git a/src/lib/elput/elput_private.h b/src/lib/elput/elput_private.h
index 217383fa7a..ee74cfc67f 100644
--- a/src/lib/elput/elput_private.h
+++ b/src/lib/elput/elput_private.h
@@ -150,6 +150,7 @@ struct _Elput_Pointer
150 double x, y; 150 double x, y;
151 int buttons; 151 int buttons;
152 unsigned int timestamp; 152 unsigned int timestamp;
153 double pressure;
153 154
154 int minx, miny; 155 int minx, miny;
155 int hotx, hoty; 156 int hotx, hoty;
@@ -179,6 +180,7 @@ struct _Elput_Touch
179 int slot; 180 int slot;
180 unsigned int points; 181 unsigned int points;
181 unsigned int timestamp; 182 unsigned int timestamp;
183 double pressure;
182 184
183 struct 185 struct
184 { 186 {