Send ConsoleKey.DownArrow with Terminal Emulation

0 votes
asked Nov 18, 2015 by mschaeffer (170 points)

I try to send ConsoleKey.DownArrow with the Terminal Emulation.
What do I have to set as keyChar Unicode character (1st parameter) when I try
ConsoleKeyInfo key = new ConsoleKeyInfo(?, ConsoleKey.DownArrow, false, false, false); _scripting.Send(key);

1 Answer

0 votes
answered Nov 19, 2015 by Pavel Matyska (12,780 points)
selected Nov 19, 2015 by Tomas Knopp
 
Best answer

Hi,

try another overload of Send method:

_scripting.Send(FunctionKey.DownArrow);

or if you need to send DownArrow with CTRL pressed, use another overload:

_scripting.Send(FunctionKey.DownArrow, ConsoleModifiers.Control);
commented Nov 19, 2015 by mschaeffer (170 points)
Why simple when it can be so complicated ;-)
Works perfect, thanks!
...