Browse Source

* adjust backspace sequence so it works according to the latest
XFree xterms and linux consoles

peter 23 years ago
parent
commit
1e06fb59d9
1 changed files with 10 additions and 27 deletions
  1. 10 27
      rtl/unix/keyboard.pp

+ 10 - 27
rtl/unix/keyboard.pp

@@ -304,31 +304,16 @@ End;
 Function IsConsole : Boolean;
 Function IsConsole : Boolean;
 var
 var
   ThisTTY: String[30];
   ThisTTY: String[30];
-  FName : String;
-  TTYfd: longint;
 begin
 begin
   IsConsole:=false;
   IsConsole:=false;
   { check for tty }
   { check for tty }
-  ThisTTY:=TTYName(stdinputhandle);
   if IsATTY(stdinputhandle) then
   if IsATTY(stdinputhandle) then
    begin
    begin
      { running on a tty, find out whether locally or remotely }
      { running on a tty, find out whether locally or remotely }
+     ThisTTY:=TTYName(stdinputhandle);
      if (Copy(ThisTTY, 1, 8) = '/dev/tty') and
      if (Copy(ThisTTY, 1, 8) = '/dev/tty') and
         (ThisTTY[9] >= '0') and (ThisTTY[9] <= '9') then
         (ThisTTY[9] >= '0') and (ThisTTY[9] <= '9') then
-      begin
-        { running on the console }
-        FName:='/dev/vcsa' + ThisTTY[9];
-        { check with read only as it might already be
-          open in ReadWrite by video unit }
-        TTYFd:=fdOpen(FName, 0, Open_RdOnly); { open console }
-      end
-     else
-      TTYFd:=-1;
-     if TTYFd<>-1 then
-      begin
-        IsConsole:=true;
-        fdClose(TTYFd);
-      end;
+       IsConsole:=true;
    end;
    end;
 end;
 end;
 
 
@@ -569,15 +554,9 @@ end;
 Procedure LoadDefaultSequences;
 Procedure LoadDefaultSequences;
 begin
 begin
   AddSpecialSequence(#27'[M',@GenMouseEvent);
   AddSpecialSequence(#27'[M',@GenMouseEvent);
-  { linux default values }
-  if IsConsole then
-    begin
-      DoAddSequence(#127,8,0);
-    end
-  else
-    begin
-      DoAddSequence(#127,0,kbDel);
-    end;
+  { linux default values, the next setting is
+    compatible with xterms from XFree 4.x }
+  DoAddSequence(#127,8,0);
   { all Esc letter }
   { all Esc letter }
   DoAddSequence(#27'A',0,kbAltA);
   DoAddSequence(#27'A',0,kbAltA);
   DoAddSequence(#27'a',0,kbAltA);
   DoAddSequence(#27'a',0,kbAltA);
@@ -1526,7 +1505,11 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.9  2001-10-12 16:03:15  peter
+  Revision 1.10  2002-03-03 13:23:51  peter
+    * adjust backspace sequence so it works according to the latest
+      XFree xterms and linux consoles
+
+  Revision 1.9  2001/10/12 16:03:15  peter
     * pollkey fixes (merged)
     * pollkey fixes (merged)
 
 
   Revision 1.8  2001/09/21 21:33:36  michael
   Revision 1.8  2001/09/21 21:33:36  michael