✅ Console Read ANSI Escape Sequence

I am running a test application to receive mouse tracking events(mouse movement/click), however, I face difficulty when trying to stream the ANSI escape sequence.

I attempted:
  • Use Console.ReadKey(true) => It refused to read ESC (\x1b)
  • Use Console.In.Read() => write the ANSI escape sequence on screen and doesn't have any result until clicking enter(which would loaded a set amount of item based on buffer size, and further item is discarded)
  • Use a StreamReader and set console input to the stream reader by Cobsole.SetOn, then use .Read() to read => Same result as above
Does anyone have suggestions on how I can receive the actual raw input (I just need an ordered sequence of byte based on the sequence of input whether the input is made by human or automatically input by terminal emulator base on ANSI escape sequence configuration)
Was this page helpful?