@@ -958,6 +958,10 @@ void InputManager::AddKeyboardInput(HWND window_handle, wchar_t character, bool
958
958
this ->UpdatePressedKeys (character, !key_up);
959
959
960
960
KeyInfo key_info = this ->GetKeyInfo (window_handle, character);
961
+ if (key_info.is_ignored_key ) {
962
+ return ;
963
+ }
964
+
961
965
if (!key_info.is_webdriver_key ) {
962
966
if (!key_info.scan_code || (key_info.key_code == 0xFFFFU )) {
963
967
LOG (WARN) << " No translation for key. Assuming unicode input: " << character;
@@ -1046,8 +1050,11 @@ bool InputManager::IsModifierKey(wchar_t character) {
1046
1050
1047
1051
KeyInfo InputManager::GetKeyInfo (HWND window_handle, wchar_t character) {
1048
1052
KeyInfo key_info;
1053
+ key_info.is_ignored_key = false ;
1049
1054
key_info.is_extended_key = false ;
1050
1055
key_info.is_webdriver_key = true ;
1056
+ key_info.key_code = 0 ;
1057
+ key_info.scan_code = 0 ;
1051
1058
DWORD process_id = 0 ;
1052
1059
DWORD thread_id = ::GetWindowThreadProcessId (window_handle, &process_id);
1053
1060
HKL layout = ::GetKeyboardLayout (thread_id);
@@ -1283,7 +1290,7 @@ KeyInfo InputManager::GetKeyInfo(HWND window_handle, wchar_t character) {
1283
1290
key_info.scan_code = VK_RETURN;
1284
1291
}
1285
1292
else if (character == L' \r ' ) { // carriage return
1286
- // skip it
1293
+ key_info. is_ignored_key = true ; // skip it
1287
1294
} else {
1288
1295
key_info.key_code = VkKeyScanExW (character, layout);
1289
1296
key_info.scan_code = MapVirtualKeyExW (LOBYTE (key_info.key_code ), 0 , layout);
0 commit comments