Skip to content

Commit

Permalink
usynergy: add logDbgSyn for keyboard, mouse
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
r-c-f committed Feb 28, 2023
1 parent a18602c commit d1396bd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/uSynergy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand All @@ -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"))
Expand All @@ -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"))
Expand All @@ -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"))
Expand All @@ -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"))
Expand All @@ -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"))
Expand All @@ -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"))
Expand All @@ -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"))
Expand Down

0 comments on commit d1396bd

Please sign in to comment.