Changeset View
Changeset View
Standalone View
Standalone View
libinput/connection.cpp
Show First 20 Lines • Show All 477 Lines • ▼ Show 20 Line(s) | 476 | case LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY: | |||
---|---|---|---|---|---|
478 | break; | 478 | break; | ||
479 | case LIBINPUT_EVENT_TABLET_TOOL_TIP: | 479 | case LIBINPUT_EVENT_TABLET_TOOL_TIP: | ||
480 | default: | 480 | default: | ||
481 | tabletEventType = KWin::InputRedirection::Tip; | 481 | tabletEventType = KWin::InputRedirection::Tip; | ||
482 | break; | 482 | break; | ||
483 | } | 483 | } | ||
484 | auto serial = libinput_tablet_tool_get_serial(tte->tool()); | 484 | auto serial = libinput_tablet_tool_get_serial(tte->tool()); | ||
485 | auto toolId = libinput_tablet_tool_get_tool_id(tte->tool()); | 485 | auto toolId = libinput_tablet_tool_get_tool_id(tte->tool()); | ||
486 | auto type = libinput_tablet_tool_get_type(tte->tool()); | ||||
487 | InputRedirection::TabletToolType toolType; | ||||
488 | switch(type) { | ||||
489 | case LIBINPUT_TABLET_TOOL_TYPE_PEN: | ||||
490 | toolType = InputRedirection::Pen; | ||||
491 | break; | ||||
492 | case LIBINPUT_TABLET_TOOL_TYPE_ERASER: | ||||
493 | toolType = InputRedirection::Eraser; | ||||
494 | break; | ||||
495 | case LIBINPUT_TABLET_TOOL_TYPE_BRUSH: | ||||
496 | toolType = InputRedirection::Brush; | ||||
497 | break; | ||||
498 | case LIBINPUT_TABLET_TOOL_TYPE_PENCIL: | ||||
499 | toolType = InputRedirection::Pencil; | ||||
500 | break; | ||||
501 | case LIBINPUT_TABLET_TOOL_TYPE_AIRBRUSH: | ||||
502 | toolType = InputRedirection::Airbrush; | ||||
503 | break; | ||||
504 | case LIBINPUT_TABLET_TOOL_TYPE_MOUSE: | ||||
505 | toolType = InputRedirection::Mouse; | ||||
506 | break; | ||||
507 | case LIBINPUT_TABLET_TOOL_TYPE_LENS: | ||||
508 | toolType = InputRedirection::Lens; | ||||
509 | break; | ||||
510 | #ifdef LIBINPUT_HAS_TOTEM | ||||
511 | case LIBINPUT_TABLET_TOOL_TYPE_TOTEM: | ||||
512 | toolType = InputRedirection::Totem; | ||||
zzag: Please don't submit commented code unless there is a reason. | |||||
513 | break; | ||||
514 | #endif | ||||
515 | } | ||||
516 | QVector<InputRedirection::Capability> capabilities; | ||||
517 | if (libinput_tablet_tool_has_pressure(tte->tool())) { | ||||
518 | capabilities << InputRedirection::Pressure; | ||||
519 | } | ||||
520 | if (libinput_tablet_tool_has_distance(tte->tool())) { | ||||
521 | capabilities << InputRedirection::Distance; | ||||
522 | } | ||||
523 | if (libinput_tablet_tool_has_rotation(tte->tool())) { | ||||
524 | capabilities << InputRedirection::Rotation; | ||||
525 | } | ||||
526 | if (libinput_tablet_tool_has_tilt(tte->tool())) { | ||||
527 | capabilities << InputRedirection::Tilt; | ||||
528 | } | ||||
529 | if (libinput_tablet_tool_has_slider(tte->tool())) { | ||||
530 | capabilities << InputRedirection::Slider; | ||||
531 | } | ||||
532 | if (libinput_tablet_tool_has_wheel(tte->tool())) { | ||||
533 | capabilities << InputRedirection::Wheel; | ||||
534 | } | ||||
486 | 535 | | |||
487 | emit tabletToolEvent(tabletEventType, | 536 | emit tabletToolEvent(tabletEventType, | ||
488 | tte->transformedPosition(m_size), tte->pressure(), | 537 | tte->transformedPosition(m_size), tte->pressure(), | ||
489 | tte->xTilt(), tte->yTilt(), tte->rotation(), | 538 | tte->xTilt(), tte->yTilt(), tte->rotation(), | ||
490 | tte->isTipDown(), tte->isNearby(), serial, | 539 | tte->isTipDown(), tte->isNearby(), serial, | ||
491 | toolId, event->device()); | 540 | toolId, toolType, capabilities, tte->time(), | ||
541 | event->device()); | ||||
492 | break; | 542 | break; | ||
493 | } | 543 | } | ||
494 | case LIBINPUT_EVENT_TABLET_TOOL_BUTTON: { | 544 | case LIBINPUT_EVENT_TABLET_TOOL_BUTTON: { | ||
495 | auto *tabletEvent = static_cast<TabletToolButtonEvent *>(event.data()); | 545 | auto *tabletEvent = static_cast<TabletToolButtonEvent *>(event.data()); | ||
496 | emit tabletToolButtonEvent(tabletEvent->buttonId(), | 546 | emit tabletToolButtonEvent(tabletEvent->buttonId(), | ||
497 | tabletEvent->isButtonPressed()); | 547 | tabletEvent->isButtonPressed()); | ||
498 | break; | 548 | break; | ||
499 | } | 549 | } | ||
▲ Show 20 Lines • Show All 221 Lines • Show Last 20 Lines |
Please don't submit commented code unless there is a reason.