mirror of
https://github.com/PowerShell/Win32-OpenSSH.git
synced 2025-07-25 15:04:54 +02:00
Manual Merge change 03234d97de12e08ab0459a985c59e8f629a6d416
ID Author Date Message 03234d97de12e08ab0459a985c59e8f629a6d416 Ray Hayes <rayhayes@rhbe.net> 9/21/2016 10:59:16 AM -07:00 Fix initialization of fields in Windows/Windows communications.
This commit is contained in:
parent
b28bc1fb79
commit
a12970d52a
@ -130,6 +130,7 @@ void SendKeyStroke(HANDLE hInput, int keyStroke, char character)
|
|||||||
ir.Event.KeyEvent.wVirtualKeyCode = keyStroke;
|
ir.Event.KeyEvent.wVirtualKeyCode = keyStroke;
|
||||||
ir.Event.KeyEvent.wVirtualScanCode = 0;
|
ir.Event.KeyEvent.wVirtualScanCode = 0;
|
||||||
ir.Event.KeyEvent.dwControlKeyState = 0;
|
ir.Event.KeyEvent.dwControlKeyState = 0;
|
||||||
|
ir.Event.KeyEvent.uChar.UnicodeChar = 0;
|
||||||
if(character != 0)
|
if(character != 0)
|
||||||
ir.Event.KeyEvent.uChar.AsciiChar = character;
|
ir.Event.KeyEvent.uChar.AsciiChar = character;
|
||||||
|
|
||||||
@ -674,6 +675,9 @@ DWORD ProcessEvent(void *p) {
|
|||||||
|
|
||||||
DWORD WINAPI ProcessEventQueue(LPVOID p) {
|
DWORD WINAPI ProcessEventQueue(LPVOID p) {
|
||||||
|
|
||||||
|
static SHORT lastX = 0;
|
||||||
|
static SHORT lastY = 0;
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
|
|
||||||
while (head) {
|
while (head) {
|
||||||
@ -728,8 +732,15 @@ DWORD WINAPI ProcessEventQueue(LPVOID p) {
|
|||||||
GetConsoleScreenBufferInfoEx(child_out, &consoleInfo);
|
GetConsoleScreenBufferInfoEx(child_out, &consoleInfo);
|
||||||
|
|
||||||
// Set the cursor to the last known good location according to the live buffer.
|
// Set the cursor to the last known good location according to the live buffer.
|
||||||
SendSetCursor(pipe_out, consoleInfo.dwCursorPosition.X + 1,
|
if (lastX != consoleInfo.dwCursorPosition.X ||
|
||||||
consoleInfo.dwCursorPosition.Y + 1);
|
lastY != consoleInfo.dwCursorPosition.Y) {
|
||||||
|
|
||||||
|
SendSetCursor(pipe_out, consoleInfo.dwCursorPosition.X + 1,
|
||||||
|
consoleInfo.dwCursorPosition.Y + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
lastX = consoleInfo.dwCursorPosition.X;
|
||||||
|
lastY = consoleInfo.dwCursorPosition.Y;
|
||||||
}
|
}
|
||||||
|
|
||||||
Sleep(100);
|
Sleep(100);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user