Changeset View
Changeset View
Standalone View
Standalone View
libinput/connection.cpp
Show First 20 Lines • Show All 522 Lines • ▼ Show 20 Line(s) | 521 | case LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY: | |||
---|---|---|---|---|---|
523 | break; | 523 | break; | ||
524 | case LIBINPUT_EVENT_TABLET_TOOL_TIP: | 524 | case LIBINPUT_EVENT_TABLET_TOOL_TIP: | ||
525 | default: | 525 | default: | ||
526 | tabletEventType = KWin::InputRedirection::Tip; | 526 | tabletEventType = KWin::InputRedirection::Tip; | ||
527 | break; | 527 | break; | ||
528 | } | 528 | } | ||
529 | auto serial = libinput_tablet_tool_get_serial(tte->tool()); | 529 | auto serial = libinput_tablet_tool_get_serial(tte->tool()); | ||
530 | auto toolId = libinput_tablet_tool_get_tool_id(tte->tool()); | 530 | auto toolId = libinput_tablet_tool_get_tool_id(tte->tool()); | ||
531 | auto type = libinput_tablet_tool_get_type(tte->tool()); | ||||
532 | InputRedirection::TabletToolType toolType; | ||||
533 | switch (type) { | ||||
534 | case LIBINPUT_TABLET_TOOL_TYPE_PEN: | ||||
535 | toolType = InputRedirection::Pen; | ||||
536 | break; | ||||
537 | case LIBINPUT_TABLET_TOOL_TYPE_ERASER: | ||||
538 | toolType = InputRedirection::Eraser; | ||||
539 | break; | ||||
540 | case LIBINPUT_TABLET_TOOL_TYPE_BRUSH: | ||||
541 | toolType = InputRedirection::Brush; | ||||
542 | break; | ||||
543 | case LIBINPUT_TABLET_TOOL_TYPE_PENCIL: | ||||
544 | toolType = InputRedirection::Pencil; | ||||
545 | break; | ||||
546 | case LIBINPUT_TABLET_TOOL_TYPE_AIRBRUSH: | ||||
547 | toolType = InputRedirection::Airbrush; | ||||
548 | break; | ||||
549 | case LIBINPUT_TABLET_TOOL_TYPE_MOUSE: | ||||
550 | toolType = InputRedirection::Mouse; | ||||
551 | break; | ||||
552 | case LIBINPUT_TABLET_TOOL_TYPE_LENS: | ||||
553 | toolType = InputRedirection::Lens; | ||||
554 | break; | ||||
555 | #ifdef LIBINPUT_HAS_TOTEM | ||||
556 | case LIBINPUT_TABLET_TOOL_TYPE_TOTEM: | ||||
557 | toolType = InputRedirection::Totem; | ||||
zzag: Please don't submit commented code unless there is a reason. | |||||
558 | break; | ||||
559 | #endif | ||||
560 | } | ||||
561 | QVector<InputRedirection::Capability> capabilities; | ||||
562 | if (libinput_tablet_tool_has_pressure(tte->tool())) { | ||||
563 | capabilities << InputRedirection::Pressure; | ||||
564 | } | ||||
565 | if (libinput_tablet_tool_has_distance(tte->tool())) { | ||||
566 | capabilities << InputRedirection::Distance; | ||||
567 | } | ||||
568 | if (libinput_tablet_tool_has_rotation(tte->tool())) { | ||||
569 | capabilities << InputRedirection::Rotation; | ||||
570 | } | ||||
571 | if (libinput_tablet_tool_has_tilt(tte->tool())) { | ||||
572 | capabilities << InputRedirection::Tilt; | ||||
573 | } | ||||
574 | if (libinput_tablet_tool_has_slider(tte->tool())) { | ||||
575 | capabilities << InputRedirection::Slider; | ||||
576 | } | ||||
577 | if (libinput_tablet_tool_has_wheel(tte->tool())) { | ||||
578 | capabilities << InputRedirection::Wheel; | ||||
579 | } | ||||
531 | 580 | | |||
532 | emit tabletToolEvent(tabletEventType, | 581 | emit tabletToolEvent(tabletEventType, | ||
533 | tte->transformedPosition(m_size), tte->pressure(), | 582 | tte->transformedPosition(m_size), tte->pressure(), | ||
534 | tte->xTilt(), tte->yTilt(), tte->rotation(), | 583 | tte->xTilt(), tte->yTilt(), tte->rotation(), | ||
535 | tte->isTipDown(), tte->isNearby(), serial, | 584 | tte->isTipDown(), tte->isNearby(), serial, | ||
536 | toolId, event->device()); | 585 | toolId, toolType, capabilities, tte->time(), | ||
586 | event->device()); | ||||
537 | break; | 587 | break; | ||
538 | } | 588 | } | ||
539 | case LIBINPUT_EVENT_TABLET_TOOL_BUTTON: { | 589 | case LIBINPUT_EVENT_TABLET_TOOL_BUTTON: { | ||
540 | auto *tabletEvent = static_cast<TabletToolButtonEvent *>(event.data()); | 590 | auto *tabletEvent = static_cast<TabletToolButtonEvent *>(event.data()); | ||
541 | emit tabletToolButtonEvent(tabletEvent->buttonId(), | 591 | emit tabletToolButtonEvent(tabletEvent->buttonId(), | ||
542 | tabletEvent->isButtonPressed()); | 592 | tabletEvent->isButtonPressed()); | ||
543 | break; | 593 | break; | ||
544 | } | 594 | } | ||
▲ Show 20 Lines • Show All 223 Lines • Show Last 20 Lines |
Please don't submit commented code unless there is a reason.