Index: remoting/host/input_injector_x11.cc |
diff --git a/remoting/host/input_injector_x11.cc b/remoting/host/input_injector_x11.cc |
index 1852e9fabc50ab43f2b8ca516d3e752f3674eb7c..54f416abda7187a5e56445e9cf62ef837bfa5143 100644 |
--- a/remoting/host/input_injector_x11.cc |
+++ b/remoting/host/input_injector_x11.cc |
@@ -327,6 +327,15 @@ void InputInjectorX11::Core::InjectTextEvent(const TextEvent& event) { |
return; |
} |
+ // Release all keys before injecting text event. This is necessary to avoid |
+ // any interference with the currently pressed keys. E.g. if Shift is pressed |
+ // when TextEvent is received. |
+ for (std::set<int>::iterator it = pressed_keys_.begin(); |
Lambros
2014/12/22 23:05:11
nit: Prefer const_iterator
Could use C++11 here: f
Sergey Ulanov
2014/12/23 00:13:28
Done.
|
+ it != pressed_keys_.end(); ++it) { |
+ XTestFakeKeyEvent(display_, *it, False, CurrentTime); |
+ } |
+ pressed_keys_.clear(); |
+ |
const std::string text = event.text(); |
for (int32 index = 0; index < static_cast<int32>(text.size()); ++index) { |
uint32_t code_point; |