Преглед на файлове

* CrtCtrlBreakHandler may not be invoked for Ctrl-C on certain platforms (Win32/Win64) - made conditional (preparation for future use as platform independent include file)

git-svn-id: trunk@35053 -
Tomas Hajny преди 9 години
родител
ревизия
7956cb5d48
променени са 1 файла, в които са добавени 6 реда и са изтрити 0 реда
  1. 6 0
      packages/rtl-console/src/inc/crt.inc

+ 6 - 0
packages/rtl-console/src/inc/crt.inc

@@ -402,11 +402,17 @@ begin
   if CtrlBreak then
     CrtCtrlBreakHandler := not (CheckBreak)
   else (* Ctrl-C pressed *)
+{$IFDEF FPC_CRT_CTRLC_TREATED_AS_KEY}
+ (* If Ctrl-C is really treated as a key, the following branch should never *)
+ (* be executed, but let's stay on the safe side and ensure predictability. *)
+   CrtCtrlBreakHandler := false;
+{$ELSE FPC_CRT_CTRLC_TREATED_AS_KEY}
     begin
       if not (SpecialKey) and (ScanCode = 0) then
         ScanCode := 3;
       CrtCtrlBreakHandler := true;
     end;
+{$ENDIF FPC_CRT_CTRLC_TREATED_AS_KEY}
 end;