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 | // case LIBINPUT_TABLET_TOOL_TYPE_TOTEM: | ||||
511 | // toolType = InputRedirection::Totem; | ||||
512 | // break; | ||||
zzag: Please don't submit commented code unless there is a reason. | |||||
513 | } | ||||
514 | QVector<InputRedirection::Capability> capabilities; | ||||
515 | if (libinput_tablet_tool_has_pressure(tte->tool())) { | ||||
516 | capabilities << InputRedirection::Pressure; | ||||
517 | } | ||||
518 | if (libinput_tablet_tool_has_distance(tte->tool())) { | ||||
519 | capabilities << InputRedirection::Distance; | ||||
520 | } | ||||
521 | if (libinput_tablet_tool_has_rotation(tte->tool())) { | ||||
522 | capabilities << InputRedirection::Rotation; | ||||
523 | } | ||||
524 | if (libinput_tablet_tool_has_tilt(tte->tool())) { | ||||
525 | capabilities << InputRedirection::Tilt; | ||||
526 | } | ||||
527 | if (libinput_tablet_tool_has_slider(tte->tool())) { | ||||
528 | capabilities << InputRedirection::Slider; | ||||
529 | } | ||||
530 | if (libinput_tablet_tool_has_wheel(tte->tool())) { | ||||
531 | capabilities << InputRedirection::Wheel; | ||||
532 | } | ||||
486 | 533 | | |||
487 | emit tabletToolEvent(tabletEventType, | 534 | emit tabletToolEvent(tabletEventType, | ||
488 | tte->transformedPosition(m_size), tte->pressure(), | 535 | tte->transformedPosition(m_size), tte->pressure(), | ||
489 | tte->xTilt(), tte->yTilt(), tte->rotation(), | 536 | tte->xTilt(), tte->yTilt(), tte->rotation(), | ||
490 | tte->isTipDown(), tte->isNearby(), serial, | 537 | tte->isTipDown(), tte->isNearby(), serial, | ||
491 | toolId, event->device()); | 538 | toolId, toolType, capabilities, tte->time(), | ||
539 | event->device()); | ||||
492 | break; | 540 | break; | ||
493 | } | 541 | } | ||
494 | case LIBINPUT_EVENT_TABLET_TOOL_BUTTON: { | 542 | case LIBINPUT_EVENT_TABLET_TOOL_BUTTON: { | ||
495 | auto *tabletEvent = static_cast<TabletToolButtonEvent *>(event.data()); | 543 | auto *tabletEvent = static_cast<TabletToolButtonEvent *>(event.data()); | ||
496 | emit tabletToolButtonEvent(tabletEvent->buttonId(), | 544 | emit tabletToolButtonEvent(tabletEvent->buttonId(), | ||
497 | tabletEvent->isButtonPressed()); | 545 | tabletEvent->isButtonPressed()); | ||
498 | break; | 546 | break; | ||
499 | } | 547 | } | ||
▲ Show 20 Lines • Show All 221 Lines • Show Last 20 Lines |
Please don't submit commented code unless there is a reason.