chore: EiScreen: conform to nameing conventions

This commit is contained in:
sithlord48 2025-08-06 19:36:53 -04:00 committed by Chris Rizzitello
parent a13803df94
commit f95230549a
2 changed files with 19 additions and 19 deletions

View file

@ -311,14 +311,14 @@ void EiScreen::fakeMouseWheel(int32_t xDelta, int32_t yDelta) const
ei_device_frame(m_eiPointer, ei_now(m_ei)); ei_device_frame(m_eiPointer, ei_now(m_ei));
} }
void EiScreen::fakeKey(uint32_t keycode, bool is_down) const void EiScreen::fakeKey(uint32_t keycode, bool isDown) const
{ {
if (!m_eiKeyboard) if (!m_eiKeyboard)
return; return;
auto xkb_keycode = keycode + 8; auto xkbKeycode = keycode + 8;
m_keyState->updateXkbState(xkb_keycode, is_down); m_keyState->updateXkbState(xkbKeycode, isDown);
ei_device_keyboard_key(m_eiKeyboard, keycode, is_down); ei_device_keyboard_key(m_eiKeyboard, keycode, isDown);
ei_device_frame(m_eiKeyboard, ei_now(m_ei)); ei_device_frame(m_eiKeyboard, ei_now(m_ei));
} }
@ -540,7 +540,7 @@ ButtonID EiScreen::mapButtonFromEvdev(ei_event *event) const
return kButtonNone; return kButtonNone;
} }
bool EiScreen::onHotkey(KeyID keyid, bool is_pressed, KeyModifierMask mask) bool EiScreen::onHotkey(KeyID keyid, bool isPressed, KeyModifierMask mask)
{ {
auto it = m_hotkeys.find(keyid); auto it = m_hotkeys.find(keyid);
@ -552,7 +552,7 @@ bool EiScreen::onHotkey(KeyID keyid, bool is_pressed, KeyModifierMask mask)
// but we don't put a limitation on modifiers in the hotkeys. So some // but we don't put a limitation on modifiers in the hotkeys. So some
// key combinations may not work correctly, more effort is needed here. // key combinations may not work correctly, more effort is needed here.
if (auto id = it->second.findByMask(mask); id != 0) { if (auto id = it->second.findByMask(mask); id != 0) {
EventTypes type = is_pressed ? EventTypes::PrimaryScreenHotkeyDown : EventTypes::PrimaryScreenHotkeyUp; EventTypes type = isPressed ? EventTypes::PrimaryScreenHotkeyDown : EventTypes::PrimaryScreenHotkeyUp;
sendEvent(type, HotKeyInfo::alloc(id)); sendEvent(type, HotKeyInfo::alloc(id));
return true; return true;
} }
@ -606,12 +606,12 @@ void EiScreen::onPointerScrollEvent(ei_event *event)
{ {
// Ratio of 10 pixels == one wheel click because that's what mutter/gtk // Ratio of 10 pixels == one wheel click because that's what mutter/gtk
// use (for historical reasons). // use (for historical reasons).
const int PIXELS_PER_WHEEL_CLICK = 10; static const int s_pixelsPerWheelClick = 10;
// Our logical wheel clicks are multiples 120, so we // Our logical wheel clicks are multiples 120, so we
// convert between the two and keep the remainders because // convert between the two and keep the remainders because
// we will very likely get subpixel scroll events. // we will very likely get subpixel scroll events.
// This means a single pixel is 120/PIXEL_TO_WHEEL_RATIO in wheel values. // This means a single pixel is 120/s_pixelToWheelRation in wheel values.
const int PIXEL_TO_WHEEL_RATIO = 120 / PIXELS_PER_WHEEL_CLICK; const int s_pixelToWheelRatio = 120 / s_pixelsPerWheelClick;
assert(m_isPrimary); assert(m_isPrimary);
@ -644,7 +644,7 @@ void EiScreen::onPointerScrollEvent(ei_event *event)
if (x != 0 || y != 0) if (x != 0 || y != 0)
sendEvent( sendEvent(
EventTypes::PrimaryScreenWheel, EventTypes::PrimaryScreenWheel,
WheelInfo::alloc((int32_t)-x * PIXEL_TO_WHEEL_RATIO, (int32_t)-y * PIXEL_TO_WHEEL_RATIO) WheelInfo::alloc((int32_t)-x * s_pixelToWheelRatio, (int32_t)-y * s_pixelToWheelRatio)
); );
remainder->x = rx; remainder->x = rx;
@ -686,13 +686,13 @@ void EiScreen::onMotionEvent(ei_event *event)
} else { } else {
m_bufferDX += dx; m_bufferDX += dx;
m_bufferDY += dy; m_bufferDY += dy;
auto pixel_dx = static_cast<std::int32_t>(m_bufferDX); auto pixelDx = static_cast<std::int32_t>(m_bufferDX);
auto pixel_dy = static_cast<std::int32_t>(m_bufferDY); auto pixelDy = static_cast<std::int32_t>(m_bufferDY);
if (pixel_dx || pixel_dy) { if (pixelDx || pixelDy) {
LOG_DEBUG1("event: motion on secondary x=%d y=%d", pixel_dx, pixel_dy); LOG_DEBUG1("event: motion on secondary x=%d y=%d", pixelDx, pixelDy);
sendEvent(EventTypes::PrimaryScreenMotionOnSecondary, MotionInfo::alloc(pixel_dx, pixel_dy)); sendEvent(EventTypes::PrimaryScreenMotionOnSecondary, MotionInfo::alloc(pixelDx, pixelDy));
m_bufferDX -= pixel_dx; m_bufferDX -= pixelDx;
m_bufferDY -= pixel_dy; m_bufferDY -= pixelDy;
} }
} }
} }

View file

@ -58,7 +58,7 @@ public:
void fakeMouseMove(std::int32_t x, std::int32_t y) override; void fakeMouseMove(std::int32_t x, std::int32_t y) override;
void fakeMouseRelativeMove(std::int32_t dx, std::int32_t dy) const override; void fakeMouseRelativeMove(std::int32_t dx, std::int32_t dy) const override;
void fakeMouseWheel(std::int32_t xDelta, std::int32_t yDelta) const override; void fakeMouseWheel(std::int32_t xDelta, std::int32_t yDelta) const override;
void fakeKey(std::uint32_t keycode, bool is_down) const; void fakeKey(std::uint32_t keycode, bool isDown) const;
// IPlatformScreen overrides // IPlatformScreen overrides
void enable() override; void enable() override;
@ -99,7 +99,7 @@ private:
void onPointerScrollDiscreteEvent(ei_event *event); void onPointerScrollDiscreteEvent(ei_event *event);
void onMotionEvent(ei_event *event); void onMotionEvent(ei_event *event);
void onAbsMotionEvent(const ei_event *) const; void onAbsMotionEvent(const ei_event *) const;
bool onHotkey(KeyID key, bool is_press, KeyModifierMask mask); bool onHotkey(KeyID key, bool isPressed, KeyModifierMask mask);
void eiLogEvent(ei_log_priority priority, const char *message) const; void eiLogEvent(ei_log_priority priority, const char *message) const;
void handleConnectedToEisEvent(const Event &event); void handleConnectedToEisEvent(const Event &event);