Skip to content

Commit

Permalink
translate values of undefined keys
Browse files Browse the repository at this point in the history
  • Loading branch information
hekra committed Jun 16, 2015
1 parent 22824dc commit f3f0538
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/webdriver/extension_qt/q_key_converter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ bool QKeyConverter::KeyCodeFromSpecialWebDriverKey(char16 key, Qt::Key* key_code
index < static_cast<int>(arraysize(kSpecialWebDriverKeys));
if (is_special_key)
*key_code = kSpecialWebDriverKeys[index];
else {
// Key_Escape = 0x01000000. Offset from this for undefined keys
int qtIndex = static_cast<int>(Qt::Key_Escape);
*key_code = static_cast<Qt::Key>(qtIndex + index);
}
return is_special_key;
}

Expand Down Expand Up @@ -265,8 +270,6 @@ bool QKeyConverter::ConvertKeysToWebKeyEvents(const string16& client_keys,
// all_modifiers | webdriver_modifiers);
}
} else {
QKeySequence tmp_keysq = QKeySequence::fromString(QString(key), QKeySequence::NativeText);
key_code = static_cast<Qt::Key>(tmp_keysq[0]);
Qt::KeyboardModifiers necessary_modifiers(0);
// ConvertCharToKeyCode(key, &key_code, &necessary_modifiers);
all_modifiers |= necessary_modifiers;
Expand Down

0 comments on commit f3f0538

Please sign in to comment.