Skip to content

Commit

Permalink
TEMP debug
Browse files Browse the repository at this point in the history
  • Loading branch information
CendioOssman committed Dec 22, 2021
1 parent 4ba99fb commit 354b955
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions vncviewer/KeyboardMacOS.mm
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@
(int)[nsevent keyCode]);
}

vlog.debug("%d / 0x%02x => 0x%04x", [nsevent keyCode], modifiers, keySym);

handler->handleKeyPress([nsevent keyCode], keyCode, keySym);

// We don't get any release events for CapsLock, so we have to
Expand Down Expand Up @@ -222,6 +224,8 @@
if (iter != keySyms.end())
continue;

vlog.debug("%d / 0x%02x => 0x%04x", systemKeyCode, mods, ks);

keySyms.push_back(ks);
}

Expand All @@ -237,6 +241,7 @@
if (iter != keySyms.end())
continue;

vlog.debug("%d / 0x%02x => 0x%04x", systemKeyCode, mods, ks);
keySyms.push_back(ks);
}

Expand Down
6 changes: 6 additions & 0 deletions vncviewer/KeyboardWin32.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,8 @@ std::list<rdr::U32> KeyboardWin32::translateToKeySyms(int systemKeyCode)
if (ks != NoSymbol)
keySyms.push_back(ks);

vlog.debug("%d / 0x%x => 0x%02x %s => 0x%04x", systemKeyCode, 0, vkey, extended ? "(extended)" : "", ks);

// Next just a single modifier at a time
for (mods = 1; mods < 16; mods <<= 1) {
std::list<rdr::U32>::const_iterator iter;
Expand All @@ -441,6 +443,8 @@ std::list<rdr::U32> KeyboardWin32::translateToKeySyms(int systemKeyCode)
if (ks == NoSymbol)
continue;

vlog.debug("%d / 0x%x => 0x%02x %s => 0x%04x", systemKeyCode, mods, vkey, extended ? "(extended)" : "", ks);

iter = std::find(keySyms.begin(), keySyms.end(), ks);
if (iter != keySyms.end())
continue;
Expand Down Expand Up @@ -468,6 +472,8 @@ std::list<rdr::U32> KeyboardWin32::translateToKeySyms(int systemKeyCode)
if (ks == NoSymbol)
continue;

vlog.debug("%d / 0x%x => 0x%02x %s => 0x%04x", systemKeyCode, mods, vkey, extended ? "(extended)" : "", ks);

iter = std::find(keySyms.begin(), keySyms.end(), ks);
if (iter != keySyms.end())
continue;
Expand Down
4 changes: 4 additions & 0 deletions vncviewer/Viewport.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,10 @@ void Viewport::handleKeyPress(int systemKeyCode,
// just the current one
keySyms = keyboard->translateToKeySyms(systemKeyCode);

vlog.debug("Hot key %d / 0x%04x:", systemKeyCode, keyCode);
for (iter = keySyms.begin(); iter != keySyms.end(); iter++)
vlog.debug("%s (0x%04x)", KeySymName(*iter), *iter);

// Then we pick the one that matches first
keySym = NoSymbol;
for (iter = keySyms.begin(); iter != keySyms.end(); iter++) {
Expand Down

0 comments on commit 354b955

Please sign in to comment.