Browse Source

* handle win32 Ctrl-C change for graphic version

pierre 23 years ago
parent
commit
3515599074
1 changed files with 29 additions and 1 deletions
  1. 29 1
      ide/fpdebug.pas

+ 29 - 1
ide/fpdebug.pas

@@ -17,6 +17,9 @@ unit FPDebug;
 interface
 interface
 
 
 uses
 uses
+{$ifdef win32}
+  Windows,
+{$endif win32}
   Objects,Dialogs,Drivers,Views,
   Objects,Dialogs,Drivers,Views,
   GDBCon,GDBInt,Menus,
   GDBCon,GDBInt,Menus,
   WViews,
   WViews,
@@ -1227,6 +1230,10 @@ end;
 
 
 
 
 procedure TDebugController.DoDebuggerScreen;
 procedure TDebugController.DoDebuggerScreen;
+{$ifdef win32}
+  var
+   IdeMode : DWord;
+{$endif win32}
 begin
 begin
   if NoSwitch then
   if NoSwitch then
     begin
     begin
@@ -1239,6 +1246,13 @@ begin
       PopStatus;
       PopStatus;
     end;
     end;
 {$ifdef win32}
 {$ifdef win32}
+   if NoSwitch then
+     begin
+       { Ctrl-C as normal char }
+       GetConsoleMode(GetStdHandle(Std_Input_Handle), @IdeMode);
+       IdeMode:=(IdeMode or ENABLE_MOUSE_INPUT or ENABLE_WINDOW_INPUT) and not ENABLE_PROCESSED_INPUT;
+       SetConsoleMode(GetStdHandle(Std_Input_Handle), IdeMode);
+     end;
    ChangeDebuggeeWindowTitleTo(Stopped_State);
    ChangeDebuggeeWindowTitleTo(Stopped_State);
 {$endif win32}
 {$endif win32}
 end;
 end;
@@ -1246,6 +1260,10 @@ end;
 
 
 procedure TDebugController.DoUserScreen;
 procedure TDebugController.DoUserScreen;
 
 
+{$ifdef win32}
+  var
+   IdeMode : DWord;
+{$endif win32}
 begin
 begin
   Inc(RunCount);
   Inc(RunCount);
   if NoSwitch then
   if NoSwitch then
@@ -1262,6 +1280,13 @@ begin
       IDEApp.ShowUserScreen;
       IDEApp.ShowUserScreen;
     end;
     end;
 {$ifdef win32}
 {$ifdef win32}
+   if NoSwitch then
+     begin
+       { Ctrl-C as interrupt }
+       GetConsoleMode(GetStdHandle(Std_Input_Handle), @IdeMode);
+       IdeMode:=(IdeMode or ENABLE_MOUSE_INPUT or ENABLE_PROCESSED_INPUT or ENABLE_WINDOW_INPUT);
+       SetConsoleMode(GetStdHandle(Std_Input_Handle), IdeMode);
+     end;
    ChangeDebuggeeWindowTitleTo(Running_State);
    ChangeDebuggeeWindowTitleTo(Running_State);
 {$endif win32}
 {$endif win32}
 end;
 end;
@@ -4088,7 +4113,10 @@ end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.19  2002-06-06 08:16:18  pierre
+  Revision 1.20  2002-06-06 14:11:25  pierre
+   * handle win32 Ctrl-C change for graphic version
+
+  Revision 1.19  2002/06/06 08:16:18  pierre
    * avoid crashes if quitting while debuggee is running
    * avoid crashes if quitting while debuggee is running
 
 
   Revision 1.18  2002/04/25 13:33:31  pierre
   Revision 1.18  2002/04/25 13:33:31  pierre