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, | ||||
488 | tte->transformedPosition(m_size), | ||||
489 | tte->pressure(), | ||||
490 | tte->xTilt(), | ||||
491 | tte->yTilt(), | ||||
492 | tte->rotation(), | ||||
493 | tte->isTipDown(), | ||||
494 | tte->isNearby(), | ||||
495 | serial, | ||||
496 | toolId, | ||||
497 | event->device()); | ||||
romangg: unnecessary many lines. group xTilt, yTilt etc. | |||||
498 | break; | ||||
499 | } | ||||
500 | case LIBINPUT_EVENT_TABLET_TOOL_BUTTON: { | ||||
501 | auto *tabletEvent = static_cast<TabletToolButtonEvent *>(event.data()); | ||||
502 | emit tabletToolButtonEvent(tabletEvent->buttonId(), tabletEvent->isButtonPressed()); | ||||
romangg: Line still too long. | |||||
503 | break; | ||||
504 | } | ||||
505 | case LIBINPUT_EVENT_TABLET_PAD_BUTTON: { | ||||
506 | auto *tabletEvent = static_cast<TabletPadButtonEvent *>(event.data()); | ||||
507 | emit tabletPadButtonEvent(tabletEvent->buttonId(), tabletEvent->isButtonPressed()); | ||||
508 | break; | ||||
509 | } | ||||
510 | case LIBINPUT_EVENT_TABLET_PAD_RING: { | ||||
511 | auto *tabletEvent = static_cast<TabletPadRingEvent *>(event.data()); | ||||
512 | emit tabletPadRingEvent(tabletEvent->number(), | ||||
513 | tabletEvent->position(), | ||||
514 | tabletEvent->source() == | ||||
515 | LIBINPUT_TABLET_PAD_RING_SOURCE_FINGER); | ||||
516 | break; | ||||
517 | } | ||||
518 | case LIBINPUT_EVENT_TABLET_PAD_STRIP: { | ||||
519 | auto *tabletEvent = static_cast<TabletPadStripEvent *>(event.data()); | ||||
520 | emit tabletPadStripEvent(tabletEvent->number(), | ||||
521 | tabletEvent->position(), | ||||
522 | tabletEvent->source() == | ||||
523 | LIBINPUT_TABLET_PAD_STRIP_SOURCE_FINGER); | ||||
524 | break; | ||||
525 | } | ||||
466 | default: | 526 | default: | ||
467 | // nothing | 527 | // nothing | ||
468 | break; | 528 | break; | ||
469 | } | 529 | } | ||
470 | } | 530 | } | ||
471 | if (wasSuspended) { | 531 | if (wasSuspended) { | ||
472 | if (m_keyboardBeforeSuspend && !m_keyboard) { | 532 | if (m_keyboardBeforeSuspend && !m_keyboard) { | ||
473 | emit hasKeyboardChanged(false); | 533 | 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.