Commit Graph

7 Commits

Author SHA1 Message Date
Ryan Prichard
44554d5e9d Add an MIT copyright notice to all the source files. 2012-03-23 03:11:34 -07:00
Ryan Prichard
ac76cbcc20 Initial checkin of improved console input handling.
* Generate Ctrl-C events by calling GenerateConsoleCtrlEvent.

   I noticed that calls to this routine don't behave exactly the same as
   a real Ctrl-C keypress.  In Python, pressing Ctrl-C immediately
   displays a new "KeyboardInterrupt" line.  Calling
   GenerateConsoleCtrlEvent has no immediate effect, but after pressing
   Enter, Python displays a stack trace where a KeyboardInterrupt was
   raised.  After some testing, I suspect the issue is that a real Ctrl-C
   keypress interrupts a blocking console read, but
   GenerateConsoleCtrlEvent does not.

   I also tried synthesizing Ctrl-C using (a) PostMessage with
   WM_{CHAR,KEYDOWN}, and (b) SendInput.  I couldn't get either to work.

 * Recognize ESC sequences.  The set of recognized sequences is ad hoc.

 * Recognize UTF-8-encoded characters and convert them to UTF-16.

 * The code currently uses a timeout to differentiate between pressing ESC
   and pressing a key that generates an ESC sequence.  I have a theory that
   I can use the "Device Status Report" ESC sequences to avoid this
   timeout.
2012-03-19 21:30:16 -07:00
Ryan Prichard
a4f26594f0 Various changes intended to help with debugging.
* Replace Buffer::isEof with Buffer::eof so I can use the agent-specific
   ASSERT macro instead of the standard assert().

 * If an API call in Win32Console fails, print a message using Trace.

 * Add Coord::toString and SmallRect::toString functions.
2012-03-15 01:59:12 -07:00
Ryan Prichard
76f25ae5dd Checkpoint work on the EventLoop and NamedPipe classes.
* Make the agent work correctly when the child process exits.
2012-03-14 02:37:18 -07:00
Ryan Prichard
d8b8403651 Begin removing the Qt dependency.
* Replace QPoint and QSize with Coord, a C++ class derived from COORD.

 * Replace QRect with SmallRect, a C++ class derived from SMALL_RECT.

 * Turn Win32Console into a non-QObject class.
2012-03-13 00:16:51 -07:00
Ryan Prichard
3abee55179 Work on agent's build system. 2012-01-21 17:39:22 -08:00
Ryan Prichard
7e4c06c2e1 Rename Agent to agent. 2012-01-21 17:32:26 -08:00