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

Method UpdatePressedKeys

cpp/iedriver/InputManager.cpp:949–969  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

947}
948
949void InputManager::UpdatePressedKeys(wchar_t character, bool press_key) {
950 std::wstring log_string = this->GetKeyDescription(character);
951 if (press_key) {
952 LOG(TRACE) << "Adding key: " << LOGWSTRING(log_string);
953 this->pressed_keys_.push_back(character);
954 } else {
955 LOG(TRACE) << "Removing key: " << LOGWSTRING(log_string);
956 std::vector<wchar_t>::const_reverse_iterator reverse_it = this->pressed_keys_.rbegin();
957 for (; reverse_it != this->pressed_keys_.rend(); ++reverse_it) {
958 if (*reverse_it == character) {
959 break;
960 }
961 }
962 if (reverse_it != this->pressed_keys_.rend()) {
963 // Must advance the forward iterator to be on the right element
964 // of the vector.
965 std::vector<wchar_t>::const_iterator it = reverse_it.base();
966 this->pressed_keys_.erase(--it);
967 }
968 }
969}
970
971void InputManager::CreateKeyboardInputItem(KeyInfo key_info,
972 DWORD initial_flags,

Callers 2

AddMouseInputMethod · 0.95
AddKeyboardInputMethod · 0.95

Calls 2

GetKeyDescriptionMethod · 0.95
LOGClass · 0.50

Tested by

no test coverage detected