MCPcopy Create free account
hub / github.com/T-Troll/alienfx-tools / KeyProc

Function KeyProc

alienfx-gui/EventHandler.cpp:360–382  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

358}
359
360LRESULT CALLBACK KeyProc(int nCode, WPARAM wParam, LPARAM lParam) {
361 if (nCode >= 0)
362 switch (wParam) {
363 case WM_KEYDOWN: case WM_SYSKEYDOWN:
364 if (!eve->keyboardSwitchActive) {
365 for (auto prof = conf->profiles.begin(); prof != conf->profiles.end(); prof++)
366 if (((LPKBDLLHOOKSTRUCT)lParam)->vkCode == ((*prof)->triggerkey & 0xff) && conf->SamePower(*prof)) {
367 eve->SwitchActiveProfile(*prof);
368 eve->keyboardSwitchActive = true;
369 break;
370 }
371 }
372 break;
373 case WM_KEYUP: case WM_SYSKEYUP:
374 if (eve->keyboardSwitchActive && ((LPKBDLLHOOKSTRUCT)lParam)->vkCode == (conf->activeProfile->triggerkey & 0xff)) {
375 eve->keyboardSwitchActive = false;
376 eve->CheckProfileChange();
377 }
378 break;
379 }
380
381 return CallNextHookEx(NULL, nCode, wParam, lParam);
382}

Callers

nothing calls this directly

Calls 3

SamePowerMethod · 0.80
SwitchActiveProfileMethod · 0.80
CheckProfileChangeMethod · 0.80

Tested by

no test coverage detected