// Console needs a way of updating its position after things have been written
// behind its back (P/Invoke puts for example).
// System.Console needs to get the DELETE character, and report accordingly.
-// Typing before the program start causes the cursor position to be wrong
-// This is caused by Console not reading all the available data
-// before sending the report-position sequence and reading it back.
//
#if NET_2_0 || NET_1_1
#define IN_MCS_BUILD
Handler.Alt ((char) 8, ConsoleKey.Backspace, CmdDeleteBackword),
// DEBUG
- Handler.Control ('T', CmdDebug),
+ //Handler.Control ('T', CmdDebug),
// quote
Handler.Control ('Q', delegate { HandleChar (Console.ReadKey (true).KeyChar); })
ConsoleKeyInfo cki;
while (!done){
+ ConsoleModifiers mod;
+
cki = Console.ReadKey (true);
+ if (cki.Key == ConsoleKey.Escape){
+ cki = Console.ReadKey (true);
+ mod = ConsoleModifiers.Alt;
+ } else
+ mod = cki.Modifiers;
+
bool handled = false;
+
foreach (Handler handler in handlers){
ConsoleKeyInfo t = handler.CKI;
- if (t.Key == cki.Key && t.Modifiers == cki.Modifiers){
+ if (t.Key == cki.Key && t.Modifiers == mod){
handled = true;
handler.KeyHandler ();
last_handler = handler.KeyHandler;
public bool NextAvailable ()
{
int next = (cursor + 1) % history.Length;
- if (count == 0 || next > head)
+ if (count == 0 || next >= head)
return false;
return true;