Skip to content

Commit

Permalink
Merge pull request #58 from minteeaa/main
Browse files Browse the repository at this point in the history
handle SYSKEY modifiers
  • Loading branch information
cafali authored Aug 15, 2024
2 parents ebd5093 + b8bc70d commit d294dba
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions SnapKey.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ void handleKeyUp(int keyCode)
currentGroupInfo.previousKey = 0;

SendKey(currentGroupInfo.activeKey, true);
}
else
}
else
{
currentGroupInfo.previousKey = 0;
if (currentGroupInfo.activeKey == keyCode) currentGroupInfo.activeKey = 0;
Expand Down Expand Up @@ -202,8 +202,8 @@ LRESULT CALLBACK KeyboardProc(int nCode, WPARAM wParam, LPARAM lParam)
if (!isSimulatedKeyEvent(pKeyBoard -> flags)) {
if (KeyInfo[pKeyBoard -> vkCode].registered)
{
if (wParam == WM_KEYDOWN) handleKeyDown(pKeyBoard -> vkCode);
if (wParam == WM_KEYUP) handleKeyUp(pKeyBoard -> vkCode);
if (wParam == WM_KEYDOWN || wParam == WM_SYSKEYDOWN) handleKeyDown(pKeyBoard -> vkCode);
if (wParam == WM_KEYUP || wParam == WM_SYSKEYUP) handleKeyUp(pKeyBoard -> vkCode);
return 1;
}
}
Expand Down Expand Up @@ -344,19 +344,19 @@ bool LoadConfig(const std::string& filename)
string key;
int value;
regex secPat(R"(\s*\[Group\]\s*)");
if (regex_match(line, secPat))
if (regex_match(line, secPat))
{
id++;
}
else if (getline(iss, key, '=') && (iss >> value))
else if (getline(iss, key, '=') && (iss >> value))
{
if (key.find("key") != string::npos)
if (key.find("key") != string::npos)
{
if (!KeyInfo[value].registered)
{
KeyInfo[value].registered = true;
KeyInfo[value].group = id;
}
}
else
{
MessageBox(NULL, TEXT("Config has repeating keys in different groups -- aborting."), TEXT("Error"), MB_ICONEXCLAMATION | MB_OK);
Expand Down

0 comments on commit d294dba

Please sign in to comment.