MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / releaseModifierKeys

Function releaseModifierKeys

cpp/webdriver-interactions/interactions.cpp:652–680  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

650}
651
652void releaseModifierKeys(WINDOW_HANDLE windowHandle, int timePerKey)
653{
654 if (!windowHandle) {
655 LOG(WARN) << "Window handle is invalid";
656 return;
657 }
658
659 HWND directInputTo = static_cast<HWND>(windowHandle);
660
661 HKL layout = attachInputToIEThread(directInputTo);
662 BYTE keyboardState[256];
663 ::ZeroMemory(keyboardState, sizeof(keyboardState));
664
665 KeySendingData sendData;
666
667 sendData.to_window = directInputTo;
668 sendData.layout = layout;
669 sendData.keyboardState = keyboardState;
670 sendData.pause_time = 35;
671
672 if ((shiftPressed) || (controlPressed) || (altPressed)) {
673 postModifierReleaseMessages(shiftPressed, controlPressed, altPressed, sendData);
674 shiftPressed = false;
675 controlPressed = false;
676 altPressed = false;
677 }
678
679 detachInputFromIEThread(directInputTo);
680}
681
682bool isSameThreadAs(HWND other)
683{

Callers

nothing calls this directly

Calls 4

attachInputToIEThreadFunction · 0.85
detachInputFromIEThreadFunction · 0.85
LOGClass · 0.70

Tested by

no test coverage detected