Merged consecutive characters issue fixed
This commit is contained in:
parent
ce43a99b30
commit
a4aff5151e
@ -134,22 +134,20 @@ void wxZRColaFrame::DoSend(const wxString& str)
|
|||||||
// Prepare the INPUT table.
|
// Prepare the INPUT table.
|
||||||
wxString::size_type n = str.length();
|
wxString::size_type n = str.length();
|
||||||
wxString::const_iterator i_str = str.begin();
|
wxString::const_iterator i_str = str.begin();
|
||||||
std::vector<INPUT> input(n);
|
std::vector<INPUT> input;
|
||||||
|
input.reserve(n*2);
|
||||||
for (std::vector<INPUT>::size_type i = 0; i < n; i++, i_str++) {
|
for (std::vector<INPUT>::size_type i = 0; i < n; i++, i_str++) {
|
||||||
wxString::char_type c = *i_str;
|
wxString::char_type c = *i_str;
|
||||||
INPUT &inp = input[i];
|
|
||||||
inp.type = INPUT_KEYBOARD;
|
// Add key down event.
|
||||||
inp.ki.dwFlags = KEYEVENTF_UNICODE;
|
INPUT inp = { INPUT_KEYBOARD };
|
||||||
inp.ki.time = 0;
|
inp.ki.dwFlags = KEYEVENTF_UNICODE;
|
||||||
inp.ki.dwExtraInfo = 0;
|
inp.ki.wScan = c != L'\n' ? c : L'\r'; // Enter (Return) key is sent as CR.
|
||||||
if (c == L'\n') {
|
input.push_back(inp);
|
||||||
// Enter (Return) key is sent as CR virtual key code.
|
|
||||||
inp.ki.wVk = VK_RETURN;
|
// Add key up event.
|
||||||
inp.ki.wScan = L'\r';
|
inp.ki.dwFlags |= KEYEVENTF_KEYUP;
|
||||||
} else {
|
input.push_back(inp);
|
||||||
inp.ki.wVk = 0;
|
|
||||||
inp.ki.wScan = c;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return focus to the source window and send the input.
|
// Return focus to the source window and send the input.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user