Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trigger keys don't handle dead keys properly #18

Open
SanderBouwhuis opened this issue Jan 3, 2022 · 2 comments
Open

Trigger keys don't handle dead keys properly #18

SanderBouwhuis opened this issue Jan 3, 2022 · 2 comments

Comments

@SanderBouwhuis
Copy link

I saw in the source code you use GetAsyncKey, which is fine.
However, you have to check for these dead keys:

WinUser.h
#define VK_LSHIFT         0xA0
#define VK_RSHIFT         0xA1
#define VK_LCONTROL       0xA2
#define VK_RCONTROL       0xA3
#define VK_LMENU          0xA4
#define VK_RMENU          0xA5

On line 1040 you check whether you found the pressed key (actually the released key, which is good):

if(keyUpTrig[i] && clickedOnceForTriggerFlag)

Then, on line 1057 you state this:

if (waitingForTrigger)
{
  _itoa_s(i, triggerText, 4, 10);
  SetFocus(outputWindow);
  SetDlgItemText(hWnd, GetDlgCtrlID(triggerButton), triggerText);
  my_trigger_key = atoi(triggerText);
  char winTxt[1024];
  memset(winTxt, 0, 1024);
  GetWindowText(triggerButton2, winTxt, 1024);
  my_trigger_key2 = atoi(winTxt);
  SetWindowTextA(press, string_format("press (clicking while: key <%d> keeps hit down)", my_trigger_key).c_str());
  SetWindowTextA(toggle, string_format("toggle (clicking begin: hit <%d>, end: hit <%d>)", my_trigger_key, my_trigger_key2).c_str());
  waitingForTrigger = false;
}

Unfortunately, you forget to also store the dead key states so that it's possible to start or end the clicking with for instance <LCTRL+1>.

@windows-2048
Copy link
Owner

Thank you a lot for a fix. I'll incorporate it to a new version.

@he3als
Copy link

he3als commented Jan 26, 2022

check your pc asap, the 'updater' is actually a miner located in your roaming appdata starting with 'Un' and contains multiple executables with 'Update'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants