MCPcopy Create free account
hub / github.com/Zalafina/QKeyMapper / FakerInputClient_sendMouseMove

Method FakerInputClient_sendMouseMove

QKeyMapper/qkeymapper_worker.cpp:6176–6204  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6174}
6175
6176bool QKeyMapper_Worker::FakerInputClient_sendMouseMove(int delta_x, int delta_y, ULONG_PTR extraInfo)
6177{
6178 Q_UNUSED(extraInfo); // Mouse move events are not tracked in hook for now
6179
6180 QMutexLocker locker(&s_FakerInputClient_Mutex);
6181
6182 if (s_FakerInputClient == Q_NULLPTR || s_FakerInputClient_ConnectState != FAKERINPUT_CONNECT_SUCCESS) {
6183#ifdef DEBUG_LOGOUT_ON
6184 qWarning() << "[FakerInputClient_sendMouseMove] FakerInput not connected!";
6185#endif
6186 return false;
6187 }
6188
6189 // Clamp delta values to valid range for FakerInput relative mouse
6190 const int MOUSE_MIN = RELATIVE_MOUSE_MIN_COORDINATE;
6191 const int MOUSE_MAX = RELATIVE_MOUSE_MAX_COORDINATE;
6192
6193 SHORT x = (SHORT)(delta_x < MOUSE_MIN ? MOUSE_MIN : (delta_x > MOUSE_MAX ? MOUSE_MAX : delta_x));
6194 SHORT y = (SHORT)(delta_y < MOUSE_MIN ? MOUSE_MIN : (delta_y > MOUSE_MAX ? MOUSE_MAX : delta_y));
6195
6196 // Send relative mouse report with current button state, movement, zero wheel
6197 bool result = fakerinput_update_relative_mouse(s_FakerInputClient, s_FakerInputMouseReport_Buttons, x, y, 0, 0);
6198
6199#ifdef DEBUG_LOGOUT_ON
6200 qDebug("[FakerInputClient_sendMouseMove] DeltaX:%d, DeltaY:%d, Result:%d", x, y, result);
6201#endif
6202
6203 return result;
6204}
6205
6206bool QKeyMapper_Worker::FakerInputClient_sendAbsoluteMouseButton(const QString &mouseButton, int x, int y, int keyupdown, ULONG_PTR extraInfo)
6207{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected