summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/elput/elput_evdev.c53
1 files changed, 52 insertions, 1 deletions
diff --git a/src/lib/elput/elput_evdev.c b/src/lib/elput/elput_evdev.c
index 539291f180..3b41db896f 100644
--- a/src/lib/elput/elput_evdev.c
+++ b/src/lib/elput/elput_evdev.c
@@ -1187,6 +1187,49 @@ cont:
1187 } 1187 }
1188} 1188}
1189 1189
1190static void
1191_tablet_tool_axis(struct libinput_device *idev, struct libinput_event_tablet_tool *event)
1192{
1193 Elput_Pointer *ptr;
1194 struct libinput_tablet_tool *tool;
1195 Elput_Device *dev = libinput_device_get_user_data(idev);
1196
1197 ptr = _evdev_pointer_get(dev->seat);
1198 EINA_SAFETY_ON_NULL_RETURN(ptr);
1199 tool = libinput_event_tablet_tool_get_tool(event);
1200
1201 ptr->x = libinput_event_tablet_tool_get_x_transformed(event, dev->ow);
1202 ptr->y = libinput_event_tablet_tool_get_y_transformed(event, dev->oh);
1203
1204 if (libinput_tablet_tool_has_pressure(tool))
1205 ptr->pressure = libinput_event_tablet_tool_get_pressure(event);
1206
1207 ptr->timestamp = libinput_event_tablet_tool_get_time(event);
1208 _pointer_motion_send(dev);
1209}
1210
1211static void
1212_tablet_tool_tip(struct libinput_device *idev, struct libinput_event_tablet_tool *event)
1213{
1214 Elput_Pointer *ptr;
1215 Elput_Device *dev = libinput_device_get_user_data(idev);
1216 int state;
1217 int press[] =
1218 {
1219 [LIBINPUT_TABLET_TOOL_TIP_DOWN] = LIBINPUT_BUTTON_STATE_PRESSED,
1220 [LIBINPUT_TABLET_TOOL_TIP_UP] = LIBINPUT_BUTTON_STATE_RELEASED,
1221 };
1222
1223 ptr = _evdev_pointer_get(dev->seat);
1224 EINA_SAFETY_ON_NULL_RETURN(ptr);
1225
1226 state = libinput_event_tablet_tool_get_tip_state(event);
1227 ptr->buttons = 1;
1228 ptr->timestamp = libinput_event_tablet_tool_get_time(event);
1229
1230 _pointer_button_send(dev, press[state]);
1231}
1232
1190int 1233int
1191_evdev_event_process(struct libinput_event *event) 1234_evdev_event_process(struct libinput_event *event)
1192{ 1235{
@@ -1225,7 +1268,15 @@ _evdev_event_process(struct libinput_event *event)
1225 case LIBINPUT_EVENT_TOUCH_UP: 1268 case LIBINPUT_EVENT_TOUCH_UP:
1226 _touch_up(idev, libinput_event_get_touch_event(event)); 1269 _touch_up(idev, libinput_event_get_touch_event(event));
1227 break; 1270 break;
1228 case LIBINPUT_EVENT_TOUCH_FRAME: 1271 case LIBINPUT_EVENT_TOUCH_FRAME: break;
1272 case LIBINPUT_EVENT_TABLET_TOOL_AXIS:
1273 _tablet_tool_axis(idev, libinput_event_get_tablet_tool_event(event));
1274 break;
1275 case LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY: /* is this useful? */
1276 break;
1277 case LIBINPUT_EVENT_TABLET_TOOL_TIP: /* is this useful? */
1278 _tablet_tool_tip(idev, libinput_event_get_tablet_tool_event(event));
1279 break;
1229 default: 1280 default:
1230 ret = 0; 1281 ret = 0;
1231 break; 1282 break;