From d1396bdc029b2271e8e1f3d63dc9bef8d743e334 Mon Sep 17 00:00:00 2001 From: Ryan Farley Date: Tue, 28 Feb 2023 13:46:16 -0600 Subject: [PATCH] usynergy: add logDbgSyn for keyboard, mouse The mouse bits are commented out for now, as this is strictly for #74 debugging at the moment, but just in case I'll leave them for easy reactivation later. --- src/uSynergy.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/uSynergy.c b/src/uSynergy.c index 6acd995..65675b2 100644 --- a/src/uSynergy.c +++ b/src/uSynergy.c @@ -446,6 +446,7 @@ static void sProcessMessage(uSynergyContext *context, struct sspBuf *msg) if (!sspChar(msg, &btn)) { PARSE_ERROR(); } + //logDbgSyn("DMDN: btn %hhd", btn); sSendMouseButtonDownCallback(context, btn); } else if (!strcmp(pkt_id, "DMUP")) @@ -456,6 +457,7 @@ static void sProcessMessage(uSynergyContext *context, struct sspBuf *msg) if (!sspChar(msg, &btn)) { PARSE_ERROR(); } + //logDbgSyn("DMUP: btn %hhd", btn); sSendMouseButtonUpCallback(context, btn); } else if (!strcmp(pkt_id, "DMMV")) @@ -466,6 +468,7 @@ static void sProcessMessage(uSynergyContext *context, struct sspBuf *msg) if (!(sspNet16(msg, &x) && sspNet16(msg, &y))) { PARSE_ERROR(); } + //logDbgSyn("DKMV: x %" PRId16 ", y %" PRId16, x, y); sSendMouseMoveCallback(context, false, x, y); } else if (!strcmp(pkt_id, "DMRM")) @@ -475,6 +478,7 @@ static void sProcessMessage(uSynergyContext *context, struct sspBuf *msg) if (!(sspNet16(msg, &x) && sspNet16(msg, &y))) { PARSE_ERROR(); } + //logDbgSyn("DKRM: x %" PRId16 ", y %" PRId16, x, y); sSendMouseMoveCallback(context, true, x, y); } else if (!strcmp(pkt_id, "DMWM")) @@ -486,6 +490,7 @@ static void sProcessMessage(uSynergyContext *context, struct sspBuf *msg) if (!(sspNet16(msg, &x) && sspNet16(msg, &y))) { PARSE_ERROR(); } + //logDbgSyn("DKWM: x %" PRId16 ", y %" PRId16, x, y); sSendMouseWheelCallback(context, x, y); } else if (!strcmp(pkt_id, "DKDN")) @@ -497,6 +502,7 @@ static void sProcessMessage(uSynergyContext *context, struct sspBuf *msg) if (!(sspNetU16(msg, &id) && sspNetU16(msg, &mod) && sspNetU16(msg, &key))) { PARSE_ERROR(); } + logDbgSyn("DKDN: id %" PRIu16 ", mod %" PRIx16 ", key %" PRIu16, id, mod, key); sSendKeyboardCallback(context, context->m_useRawKeyCodes ? key : id, id, mod, true, false); } else if (!strcmp(pkt_id, "DKRP")) @@ -511,6 +517,7 @@ static void sProcessMessage(uSynergyContext *context, struct sspBuf *msg) sspNetU16(msg, &key))) { PARSE_ERROR(); } + logDbgSyn("DKRP: id %" PRIu16 ", mod %" PRIx16 ", count %" PRIu16 ", key %" PRIu16, id, mod, count, key); sSendKeyboardCallback(context, context->m_useRawKeyCodes ? key : id, id, mod, true, true); } else if (!strcmp(pkt_id, "DKUP")) @@ -522,6 +529,7 @@ static void sProcessMessage(uSynergyContext *context, struct sspBuf *msg) if (!(sspNetU16(msg, &id) && sspNetU16(msg, &mod) && sspNetU16(msg, &key))) { PARSE_ERROR(); } + logDbgSyn("DKUP: id %" PRIu16 ", mod %" PRIx16 ", key %" PRIu16, id, mod, key); sSendKeyboardCallback(context, context->m_useRawKeyCodes ? key : id, id, mod, false, false); } else if (!strcmp(pkt_id, "DGBT"))