Changeset View
Changeset View
Standalone View
Standalone View
libinput/connection.cpp
Show First 20 Lines • Show All 457 Lines • ▼ Show 20 Line(s) | 452 | case LIBINPUT_EVENT_SWITCH_TOGGLE: { | |||
---|---|---|---|---|---|
458 | case SwitchEvent::State::On: | 458 | case SwitchEvent::State::On: | ||
459 | emit switchToggledOn(se->time(), se->timeMicroseconds(), se->device()); | 459 | emit switchToggledOn(se->time(), se->timeMicroseconds(), se->device()); | ||
460 | break; | 460 | break; | ||
461 | default: | 461 | default: | ||
462 | Q_UNREACHABLE(); | 462 | Q_UNREACHABLE(); | ||
463 | } | 463 | } | ||
464 | break; | 464 | break; | ||
465 | } | 465 | } | ||
466 | case LIBINPUT_EVENT_TABLET_TOOL_AXIS: | ||||
467 | case LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY: | ||||
468 | case LIBINPUT_EVENT_TABLET_TOOL_TIP: { | ||||
469 | auto *tte = static_cast<TabletToolEvent *>(event.data()); | ||||
470 | | ||||
471 | KWin::InputRedirection::TabletEventType tabletEventType; | ||||
romangg: Do not use single letter variable names. Minimum two letters. Same below with `e`. | |||||
472 | switch (event->type()) { | ||||
473 | case LIBINPUT_EVENT_TABLET_TOOL_AXIS: | ||||
474 | tabletEventType = KWin::InputRedirection::Axis; | ||||
475 | break; | ||||
476 | case LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY: | ||||
477 | tabletEventType = KWin::InputRedirection::Proximity; | ||||
478 | break; | ||||
479 | case LIBINPUT_EVENT_TABLET_TOOL_TIP: | ||||
480 | default: | ||||
481 | tabletEventType = KWin::InputRedirection::Tip; | ||||
482 | break; | ||||
483 | } | ||||
484 | auto serial = libinput_tablet_tool_get_serial(tte->tool()); | ||||
485 | auto toolId = libinput_tablet_tool_get_tool_id(tte->tool()); | ||||
486 | | ||||
487 | emit tabletToolEvent(tabletEventType, tte->transformedPosition(m_size), | ||||
488 | tte->pressure(), tte->xTilt(), tte->yTilt(), tte->rotation(), | ||||
489 | tte->isTipDown(), tte->isNearby(), | ||||
490 | serial, toolId, event->device()); | ||||
491 | break; | ||||
492 | } | ||||
493 | case LIBINPUT_EVENT_TABLET_TOOL_BUTTON: { | ||||
494 | auto *tabletEvent = static_cast<TabletToolButtonEvent *>(event.data()); | ||||
495 | emit tabletToolButtonEvent(tabletEvent->buttonId(), tabletEvent->isButtonPressed()); | ||||
496 | break; | ||||
497 | } | ||||
romangg: unnecessary many lines. group xTilt, yTilt etc. | |||||
498 | case LIBINPUT_EVENT_TABLET_PAD_BUTTON: { | ||||
499 | auto *tabletEvent = static_cast<TabletPadButtonEvent *>(event.data()); | ||||
500 | emit tabletPadButtonEvent(tabletEvent->buttonId(), tabletEvent->isButtonPressed()); | ||||
501 | break; | ||||
502 | } | ||||
romangg: Line still too long. | |||||
503 | case LIBINPUT_EVENT_TABLET_PAD_RING: { | ||||
504 | auto *tabletEvent = static_cast<TabletPadRingEvent *>(event.data()); | ||||
505 | emit tabletPadRingEvent(tabletEvent->number(), tabletEvent->position(), | ||||
506 | tabletEvent->source() == LIBINPUT_TABLET_PAD_RING_SOURCE_FINGER); | ||||
507 | break; | ||||
508 | } | ||||
509 | case LIBINPUT_EVENT_TABLET_PAD_STRIP: { | ||||
510 | auto *tabletEvent = static_cast<TabletPadStripEvent *>(event.data()); | ||||
511 | emit tabletPadStripEvent(tabletEvent->number(), tabletEvent->position(), | ||||
512 | tabletEvent->source() == LIBINPUT_TABLET_PAD_STRIP_SOURCE_FINGER); | ||||
513 | break; | ||||
514 | } | ||||
466 | default: | 515 | default: | ||
467 | // nothing | 516 | // nothing | ||
468 | break; | 517 | break; | ||
469 | } | 518 | } | ||
470 | } | 519 | } | ||
471 | if (wasSuspended) { | 520 | if (wasSuspended) { | ||
472 | if (m_keyboardBeforeSuspend && !m_keyboard) { | 521 | if (m_keyboardBeforeSuspend && !m_keyboard) { | ||
473 | emit hasKeyboardChanged(false); | 522 | emit hasKeyboardChanged(false); | ||
▲ Show 20 Lines • Show All 191 Lines • Show Last 20 Lines |
Do not use single letter variable names. Minimum two letters. Same below with e.