DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: B T

⟦5595b019e⟧ TextFile

    Length: 64389 (0xfb85)
    Types: TextFile
    Names: »B«

Derivation

└─⟦180fe333a⟧ Bits:30000405 8mm tape, Rational 1000, SW CATALOG, 10_20_0
└─⟦180fe333a⟧ Bits:30000537 8mm tape, Rational 1000, SW Catalog 10_20_0
    └─⟦5cb1d1d7f⟧ »DATA« 
        └─⟦3b1ee7bd8⟧ 
            └─⟦this⟧ 

TextFile

with Access_List;
with Ada;
with Command;
with Common;
with Compilation;
with Cmvc;
with Debug;
with Editor;  
with Job;
with Library;
with Text;
with Queue;
with Key;
with Vt220_Visible_Key_Names;
with What;

procedure Vt220_Commands is

    -- Release 1.3
    -- PSM
    -- 01/29/88
    --
    -- The case alternatives for '~' is required to capture the additional
    -- escape sequence character sent by the function keys.  I removed the
    -- '~' from Vt220_keys on some of the function keys to gain acces to
    -- all the function keys.  Due to how  escape sequences are allocated to
    -- internal tables all the function keys would not have been definable
    -- since the 15 table limit would have been exceeded.  It's a kludge
    -- but it works!
    --
    -- F6, F7, F8, F10, and F16 capture the '~' in Vt220_Keys and do not
    -- require the case alternative.  Also, the When Others=> doesn't seem
    -- to handle the missing '~' so an alternative has been added to beep
    -- at the user when an undefined functioin key is pressed.
    --

    use Vt220_Visible_Key_Names;

    type Intent is (Prompt, Execute, Interrupt);

    Action : Intent;

    Key_1 : Vt220_Key_Names;
    Key_2 : Vt220_Key_Names;
    Key_3 : Vt220_Key_Names;
    Key_4 : Vt220_Key_Names;


begin
    case Action is
        when Interrupt =>
            case Key_1 is

                when C_G =>
                    Job.Interrupt;
                when C_C =>
                    Job.Kill (The_Job => 0, The_Session => "");

                when Numeric_2 =>
                    Key;

                when Numeric_4 =>
                    case Key_2 is
                        when F6 =>
                            Debug.Stop (Name => "");
                        when others =>
                            Key;
                    end case;

                when others =>
                    case Key_2 is
                        when '~' =>
                            Key;
                        when others =>
                            Key;
                    end case;
            end case;


        when Prompt =>
            case Key_1 is

                when Object =>
                    case Key_2 is
                        when 'l' | 'L' =>
                            Common.Revert;
                        when others =>
                            Key;
                    end case;

                when Numeric_1 =>
                    case Key_2 is
                        when F8 =>
                            Debug.Modify;
                        when others =>
                            Key;
                    end case;

                when Numeric_6 =>
                    case Key_2 is
                        when F14 =>
                            case Key_3 is
                                when '~' =>
                                    Library.Create_Directory;
                                when others =>
                                    Key;
                            end case;
                        when others =>
                            Key;
                    end case;

                when Numeric_7 =>
                    case Key_2 is
                        when F14 =>
                            case Key_3 is
                                when '~' =>
                                    Library.Create_World;
                                when others =>
                                    Key;
                            end case;
                        when others =>
                            Key;
                    end case;

                when Numeric_8 =>
                    case Key_2 is
                        when F14 =>
                            case Key_3 is
                                when '~' =>
                                    Text.Create;
                                when others =>
                                    Key;
                            end case;
                        when others =>
                            Key;
                    end case;

                when others =>
                    case Key_2 is
                        when '~' =>
                            Key;
                        when others =>
                            Key;
                    end case;
            end case;


        when Execute =>
            case Key_1 is

                when Up =>
                    Editor.Cursor.Up;
                when Down =>
                    Editor.Cursor.Down;
                when Right =>
                    Editor.Cursor.Right;
                when Left =>
                    Editor.Cursor.Left;

                when Begin_Of =>
                    Editor.Line.Beginning_Of;
                when End_Of =>  
                    Editor.Line.End_Of;

                when Enter =>
                    Common.Commit;

                when C_D =>
                    Editor.Char.Delete_Forward;
                when C_I =>
                    Editor.Char.Tab_Forward;
                when C_K =>
                    Editor.Line.Delete_Forward;
                when C_L =>
                    Editor.Screen.Redraw;
                when C_M =>
                    Editor.Line.Indent;
                when C_N =>
                    Editor.Cursor.Next;
                when C_O =>
                    Editor.Line.Open;
                when C_P =>
                    Editor.Cursor.Previous;
                when C_T =>
                    Editor.Char.Transpose;
                when C_X =>
                    Editor.Set.Designation_Off;
                when C_Y =>
                    Editor.Hold_Stack.Top;

                when Delete =>
                    Editor.Char.Delete_Backward;

                when F6 =>
                    Debug.Run;
                when F7 =>
                    Debug.Source;
                when F8 =>
                    Debug.Put;

                when F9 =>
                    case Key_2 is
                        when '~' =>
                            Common.Enclosing;
                        when others =>
                            Key;
                    end case;

                when F10 =>
                    Common.Definition;

                when F11 =>
                    case Key_2 is
                        when '~' =>
                            Editor.Key.Prompt;
                        when others =>
                            Key;
                    end case;

                when F12 =>
                    case Key_2 is
                        when '~' =>
                            Ada.Install_Unit;
                        when others =>
                            Key;
                    end case;

                when F13 =>
                    case Key_2 is
                        when '~' =>
                            Common.Edit;
                        when others =>
                            Key;
                    end case;

                when F14 =>
                    case Key_2 is
                        when '~' =>
                            Common.Create_Command;
                        when others =>
                            Key;
                    end case;

                when F15 =>
                    case Key_2 is
                        when '~' =>
                            What.Does ("");
                        when others =>
                            Key;
                    end case;

                when F16 =>
                    Common.Promote;

                when F17 =>
                    case Key_2 is
                        when '~' =>
                            Common.Format;
                        when others =>
                            Key;
                    end case;

                when F18 =>
                    case Key_2 is
                        when '~' =>
                            Common.Complete;
                        when others =>
                            Key;
                    end case;

                when F19 =>
                    case Key_2 is
                        when '~' =>
                            Common.Semanticize;
                        when others =>
                            Key;
                    end case;

                when F20 =>
                    case Key_2 is
                        when '~' =>
                            Common.Explain;
                        when others =>
                            Key;
                    end case;


                when Numeric_1 =>
                    case Key_2 is
                        when F6 =>
                            Debug.Execute;
                        when F7 =>
                            Debug.Break (Location => "<SELECTION>",
                                         Stack_Frame => 0,
                                         Count => 1,
                                         In_Task => "",
                                         Default_Lifetime => False);

                            -- F8 Debug.Modify is Prompted

                        when F9 =>
                            case Key_3 is
                                when '~' =>
                                    Common.Enclosing (In_Place => True,
                                                      Library => False);
                                when others =>
                                    Key;
                            end case;

                        when F10 =>
                            Common.Definition (Name => "<CURSOR>",
                                               In_Place => True,
                                               Visible => True);

                        when F11 =>
                            case Key_3 is
                                when '~' =>
                                    Cmvc.Show_Out_Of_Date_Objects;
                                when others =>
                                    Key;
                            end case;

                        when F12 =>
                            case Key_3 is
                                when '~' =>
                                    Ada.Install_Stub;
                                when others =>
                                    Key;
                            end case;

                        when F13 =>
                            case Key_3 is
                                when '~' =>
                                    Common.Demote;
                                when others =>
                                    Key;
                            end case;

                        when F14 =>
                            case Key_3 is
                                when '~' =>
                                    Ada.Create_Body;
                                when others =>
                                    Key;
                            end case;

                        when F15 =>
                            case Key_3 is
                                when '~' =>
                                    What.Does (Name => "Help_on_Help");
                                when others =>
                                    Key;
                            end case;

                        when F16 =>
                            Command.Debug;

                        when F17 =>
                            case Key_3 is
                                when '~' =>
                                    Ada.Get_Errors;
                                when others =>
                                    Key;
                            end case;

                        when F18 =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;

                        when F19 =>
                            case Key_3 is
                                when '~' =>
                                    Editor.Cursor.Next (Repeat => 1,
                                                        Prompt => True,
                                                        Underline => False);
                                when others =>
                                    Key;
                            end case;

                        when F20 =>
                            case Key_3 is
                                when '~' =>
                                    What.Object;
                                when others =>
                                    Key;
                            end case;

                        when others =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;
                    end case;



                when Numeric_2 =>
                    case Key_2 is
                        when F6 =>
                            Debug.Run (Stop_At => Debug.Local_Statement);
                        when F7 =>
                            Debug.Break;
                        when F8 =>
                            Debug.Stack;

                        when F9 =>
                            case Key_3 is
                                when '~' =>
                                    What.Home_Library;
                                when others =>
                                    Key;
                            end case;

                        when F10 =>  
                            Ada.Other_Part;

                        when F11 =>
                            case Key_3 is
                                when '~' =>
                                    Cmvc.Check_Out;
                                when others =>
                                    Key;
                            end case;

                        when F12 =>
                            case Key_3 is
                                when '~' =>
                                    Ada.Code_Unit;
                                when others =>
                                    Key;
                            end case;

                        when F13 =>
                            case Key_3 is
                                when '~' =>
                                    Ada.Source_Unit;
                                when others =>
                                    Key;
                            end case;

                        when F14 =>
                            case Key_3 is
                                when '~' =>
                                    Common.Object.Insert;
                                when others =>
                                    Key;
                            end case;

                        when F15 =>
                            case Key_3 is
                                when '~' =>
                                    Editor.Key.Name (Key_Code => "");
                                when others =>
                                    Key;
                            end case;

                            -- Numeric_2 F16 Job.Kill is prompted

                        when F17 =>
                            case Key_3 is
                                when '~' =>
                                    Common.Clear_Underlining;
                                when others =>
                                    Key;
                            end case;

                        when F18 =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;

                        when F19 =>
                            case Key_3 is
                                when '~' =>
                                    Editor.Cursor.Previous
                                       (Prompt => False, Underline => True);
                                when others =>
                                    Key;
                            end case;

                        when F20 =>
                            case Key_3 is
                                when '~' =>
                                    What.Users;
                                when others =>
                                    Key;
                            end case;

                        when others =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;
                    end case;


                when Numeric_3 =>
                    case Key_2 is
                        when F6 =>
                            Debug.Run (Stop_At => Debug.Returned);
                        when F7 =>
                            Debug.Activate (Breakpoint => 0);
                        when F8 =>
                            Debug.Forget;

                        when F9 =>
                            case Key_3 is
                                when '~' =>
                                    Common.Enclosing (In_Place => True,
                                                      Library => True);
                                when others =>
                                    Key;
                            end case;


                        when F10 =>
                            Ada.Other_Part (In_Place => True);

                        when F11 =>
                            case Key_3 is
                                when '~' =>
                                    Cmvc.Check_In (What_Object => "<CURSOR>",
                                                   Comments => "",
                                                   Work_Order => "<DEFAULT>",
                                                   Response => "<PROFILE>");
                                when others =>
                                    Key;
                            end case;

                        when F12 =>
                            case Key_3 is
                                when '~' =>
                                    Compilation.Promote
                                       (Unit => "<IMAGE>",
                                        Scope => Compilation.All_Parts,
                                        Goal => Compilation.Installed,
                                        Limit => "<WORLDS>",
                                        Effort_Only => False,
                                        Response => "<PROFILE>");
                                when others =>
                                    Key;
                            end case;

                        when F13 =>
                            case Key_3 is
                                when '~' =>
                                    Compilation.Demote
                                       (Unit => "<SELECTION>",
                                        Goal => Compilation.Source,
                                        Limit => "<WORLDS>",
                                        Effort_Only => False,
                                        Response => "<PROFILE>");

                                when others =>
                                    Key;
                            end case;


                        when F14 =>
                            case Key_3 is  
                                when '~' =>
                                    Ada.Create_Private (Name => "<IMAGE>");
                                when others =>
                                    Key;
                            end case;


                        when F15 =>
                            case Key_3 is
                                when '~' =>
                                    Editor.Image.Find (Name => "Help Window");
                                when others =>
                                    Key;
                            end case;

                        when F16 =>
                            Key;

                        when F17 =>
                            case Key_3 is
                                when '~' =>
                                    Ada.Show_Usage (Name => "<CURSOR>",
                                                    Global => False,
                                                    Limit => "<WORLDS>",
                                                    Closure => False);
                                when others =>
                                    Key;
                            end case;

                        when F18 =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;

                        when F19 =>
                            case Key_3 is
                                when '~' =>
                                    Editor.Cursor.Previous (Repeat => 1,
                                                            Prompt => True,
                                                            Underline => False);
                                when others =>
                                    Key;
                            end case;

                        when F20 =>
                            case Key_3 is
                                when '~' =>
                                    What.Locks;
                                when others =>
                                    Key;
                            end case;

                        when others =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;
                    end case;


                when Numeric_4 =>
                    case Key_2 is

                        -- Numeric_4 F6 Debug.Stop is an Interrupt

                        when F7 =>
                            Debug.Remove (Breakpoint => 0, Delete => False);

                        when F8 =>
                            Debug.Catch (Name => "<SELECTION>",
                                         In_Task => "",
                                         At_Location => "");

                        when F9 =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;

                        when F10 =>  
                            Key;

                        when F11 =>
                            case Key_3 is
                                when '~' =>
                                    Cmvc.Show;
                                when others =>
                                    Key;
                            end case;

                        when F12 =>
                            case Key_3 is
                                when '~' =>
                                    Compilation.Promote
                                       (Unit => "<IMAGE>",
                                        Scope => Compilation.All_Parts,
                                        Goal => Compilation.Installed,
                                        Limit => "<ALL_WORLDS>",
                                        Effort_Only => False,
                                        Response => "<PROFILE>");
                                when others =>
                                    Key;
                            end case;

                        when F13 =>
                            case Key_3 is
                                when '~' =>
                                    Compilation.Demote
                                       (Unit => "<SELECTION>",
                                        Goal => Compilation.Source,
                                        Limit => "<ALL_WORLDS>",
                                        Effort_Only => False,
                                        Response => "<PROFILE>");
                                when others =>
                                    Key;
                            end case;

                        when F14 =>  
                            case Key_3 is
                                when '~' =>
                                    Ada.Make_Separate;
                                when others =>
                                    Key;
                            end case;

                        when F15 =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;


                        when F16 =>
                            Key;

                        when F17 =>
                            case Key_3 is
                                when '~' =>
                                    Ada.Show_Usage (Name => "<CURSOR>",
                                                    Global => True,
                                                    Limit => "<ALL_WORLDS>",
                                                    Closure => False);
                                when others =>
                                    Key;
                            end case;

                        when F18 =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;

                        when F19 =>
                            case Key_3 is
                                when '~' =>
                                    Editor.Cursor.Previous
                                       (Prompt => False, Underline => True);
                                when others =>
                                    Key;
                            end case;

                        when F20 =>
                            case Key_3 is
                                when '~' =>
                                    Access_List.Display
                                       (For_Object => "<CURSOR>");
                                when others =>
                                    Key;
                            end case;

                        when others =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;
                    end case;


                when Numeric_5 =>
                    case Key_2 is

                        when F6 =>
                            Debug.Information
                               (Info_Type => Debug.Rendezvous, For_Task => "");

                        when F7 =>
                            Debug.Show (Values_For => Debug.Breakpoints);

                        when F8 =>
                            Debug.Propagate (Name => "<SELECTION>",
                                             In_Task => "",
                                             At_Location => "");

                        when F9 =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;

                        when F10 =>
                            Key;

                        when F11 =>
                            case Key_3 is
                                when '~' =>
                                    Cmvc.Accept_Changes
                                       (Allow_Demotion => False);
                                when others =>
                                    Key;
                            end case;

                        when F12 =>
                            case Key_3 is
                                when '~' =>
                                    Compilation.Make
                                       (Unit => "<IMAGE>",
                                        Scope => Compilation.All_Parts,
                                        Goal => Compilation.Coded,
                                        Limit => "<WORLDS>",
                                        Effort_Only => False,
                                        Response => "<PROFILE>");

                                when others =>
                                    Key;
                            end case;

                        when F13 =>
                            case Key_3 is
                                when '~' =>
                                    Compilation.Demote
                                       (Unit => "<SELECTION>",
                                        Goal => Compilation.Installed,
                                        Limit => "<WORLDS>",
                                        Effort_Only => False,
                                        Response => "<PROFILE>");
                                when others =>
                                    Key;
                            end case;

                        when F14 =>
                            case Key_3 is
                                when '~' =>
                                    Ada.Make_Inline;
                                when others =>
                                    Key;
                            end case;

                        when F15 =>
                            case Key_3 is
                                when '~' =>
                                    Queue.Print;
                                when others =>
                                    Key;
                            end case;

                        when F16 =>
                            Key;

                        when F17 =>
                            case Key_3 is
                                when '~' =>
                                    Ada.Show_Usage (Name => "<CURSOR>",
                                                    Global => True,
                                                    Limit => "<ALL_WORLDS>",
                                                    Closure => True);
                                when others =>
                                    Key;
                            end case;

                        when F18 =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;

                        when F19 =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;

                        when F20 =>
                            case Key_3 is
                                when '~' =>
                                    Access_List.Default_Display
                                       (For_World => "<CURSOR>");
                                when others =>
                                    Key;
                            end case;

                        when others =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;
                    end case;


                when Numeric_6 =>
                    case Key_2 is
                        when F6 =>
                            Debug.Task_Display (For_Task => "",
                                                Task_Set => Debug.All_Tasks);

                        when F7 =>
                            Key;

                        when F8 =>
                            Debug.Show (Values_For => Debug.Exceptions);

                        when F9 =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;

                        when F10 =>
                            Key;

                        when F11 =>
                            case Key_3 is
                                when '~' =>
                                    Cmvc.Show_Checked_Out_By_User
                                       (In_View => "<CURSOR>",
                                        Response => "<PROFILE>");
                                when others =>
                                    Key;
                            end case;

                        when F12 =>
                            case Key_3 is
                                when '~' =>
                                    Compilation.Make
                                       (Unit => "<IMAGE>",
                                        Scope => Compilation.Load_Views,
                                        Goal => Compilation.Coded,
                                        Limit => "<ALL_WORLDS>",
                                        Effort_Only => False,
                                        Response => "<PROFILE>");
                                when others =>
                                    Key;
                            end case;

                        when F13 =>
                            case Key_3 is
                                when '~' =>
                                    Compilation.Demote
                                       (Unit => "<SELECTION>",
                                        Goal => Compilation.Installed,
                                        Limit => "<ALL_WORLDS>",
                                        Effort_Only => False,
                                        Response => "<PROFILE>");
                                when others =>
                                    Key;
                            end case;

                            --Numeric_6 F14 Create Directory is prompted

                        when F15 =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;

                        when F16 =>
                            Key;

                        when F17 =>
                            case Key_3 is
                                when '~' =>
                                    Ada.Show_Unused
                                       (In_Unit => "<IMAGE>",
                                        Check_Other_Units => False);
                                when others =>
                                    Key;
                            end case;

                        when F18 =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;

                        when F19 =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;

                        when F20 =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;


                        when others =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;
                    end case;


                when Numeric_7 =>
                    case Key_2 is
                        when F6 =>
                            Debug.Task_Display;

                        when F7 =>
                            Key;

                        when F8 =>
                            Debug.Current_Debugger (Target => "");

                        when F9 =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;

                        when F10 =>
                            Key;

                        when F11 =>
                            case Key_3 is
                                when '~' =>
                                    Cmvc.Show_Checked_Out_In_View
                                       (In_View => "<CURSOR>",
                                        Response => "<PROFILE>");

                                when others =>
                                    Key;
                            end case;

                        when F12 =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;

                        when F13 =>
                            case Key_3 is
                                when '~' =>
                                    Ada.Withdraw (Name => "<IMAGE>");
                                when others =>
                                    Key;
                            end case;

                            -- Numeric_7 F14 Create_World is prompted

                        when F15 =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;

                        when F16 =>
                            Key;

                        when F17 =>
                            case Key_3 is
                                when '~' =>
                                    Ada.Show_Unused (In_Unit => "<IMAGE>",
                                                     Check_Other_Units => True);
                                when others =>
                                    Key;
                            end case;

                        when F18 =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;

                        when F19 =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;

                        when F20 =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;


                        when others =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;  
                    end case;



                when Numeric_8 =>
                    case Key_2 is
                        when F6 =>
                            Debug.Set_Value
                               (Variable => Debug.First_Element, To_Value => 0);

                        when F7 =>
                            Debug.Set_Value
                               (Variable => Debug.Element_Count, To_Value => 5);

                        when F8 =>
                            Debug.Set_Value
                               (Variable => Debug.Pointer_Level, To_Value => 5);

                        when F9 =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;

                        when F10 =>
                            Key;

                        when F11 =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;

                        when F12 =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;

                        when F13 =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;

                            -- Numeric_8 F14 Create Text is prompted

                        when F15 =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;

                        when F16 =>
                            Key;

                        when F17 =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;

                        when F18 =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;

                        when F19 =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;

                        when F20 =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;


                        when others =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;  
                    end case;



                when Numeric_9 =>
                    case Key_2 is
                        when F6 =>
                            Key;

                        when F7 =>
                            Key;

                        when F8 =>
                            Key;

                        when F9 =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;

                        when F10 =>
                            Key;

                        when F11 =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;

                        when F12 =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;

                        when F13 =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;

                        when F14 =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;

                        when F15 =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;

                        when F16 =>
                            Key;

                        when F17 =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;

                        when F18 =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;

                        when F19 =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;

                        when F20 =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;


                        when others =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;  
                    end case;


                when Numeric_0 =>
                    Editor.Set.Argument_Prefix;
                    -- This allows the use of the numeric keys on the main
                    -- keyboard to set argument prefix values since the
                    -- numeric keypad is used to modify the function keys.
                    -- e.g. To delete 5 lines press Numeric_0 followed by
                    -- the digit 5 on the main keyboard then line 'D'.
                    -- Amazing, eh?


                when Object =>
                    case Key_2 is

                        when '1' | '!' =>
                            Common.Expand;
                        when '.' | '>' =>
                            Common.Elide;
                        when '/' | '?' =>
                            Common.Explain;
                        when 'c' | 'C' =>
                            Common.Object.Copy;
                        when 'd' | 'D' | 'k' | 'K' =>
                            Common.Object.Delete;
                        when 'g' | 'G' =>
                            Common.Abandon;
                        when 'i' | 'I' =>
                            Common.Object.Insert;
                        when 'm' | 'M' =>
                            Common.Object.Move;
                        when 'x' | 'X' =>
                            Common.Release;
                        when 'r' | 'R' =>
                            Common.Redo;
                        when 's' | 'S' =>
                            Common.Sort_Image;
                        when 'u' | 'U' =>
                            Common.Undo;
                        when Down =>
                            Common.Object.Next;
                        when Left =>
                            Common.Object.Parent;
                        when Right =>
                            Common.Object.Child;
                        when Up =>
                            Common.Object.Previous;
                        when Begin_Of =>
                            Common.Object.First_Child;
                        when End_Of =>
                            Common.Object.Last_Child;

                        when F10 =>
                            Common.Definition;

                        when Tab =>
                            Editor.Char.Tab_To_Comment;

                        when others =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;
                    end case;


                when Region =>  
                    case Key_2 is
                        when '-' | '_' =>
                            Editor.Region.Comment;
                        when '=' | '+' =>
                            Editor.Region.Uncomment;
                        when 'r' | 'R' =>
                            Editor.Hold_Stack.Rotate;
                        when 't' | 'T' =>
                            Editor.Hold_Stack.Swap;
                        when 'X' | 'x' =>
                            Editor.Region.Off;
                        when '<' | ',' =>
                            Editor.Region.Lower_Case;
                        when '>' | '.' =>
                            Editor.Region.Upper_Case;
                        when 'c' | 'C' =>
                            Editor.Region.Copy;
                        when 'd' | 'D' | 'k' | 'K' =>
                            Editor.Region.Delete;
                        when 'm' | 'M' =>
                            Editor.Region.Move;
                        when '[' | '{' =>
                            Editor.Region.Start;
                        when ']' | '}' =>
                            Editor.Region.Finish;
                        when '^' | '6' =>
                            Editor.Region.Capitalize;
                        when End_Of =>
                            Editor.Region.End_Of;
                        when Begin_Of =>
                            Editor.Region.Beginning_Of;
                        when Left =>
                            Editor.Hold_Stack.Previous;
                        when Right =>
                            Editor.Hold_Stack.Next;
                        when Up =>
                            Editor.Hold_Stack.Top;
                        when Down =>
                            Editor.Hold_Stack.Push;
                        when 'p' | 'P' =>
                            Editor.Hold_Stack.Copy_Top;
                        when Delete =>
                            Editor.Hold_Stack.Delete_Top;

                        when Numeric_2 =>
                            case Key_3 is
                                when F16 =>
                                    Editor.Region.Fill;
                                when others =>
                                    Key;
                            end case;

                        when Numeric_1 =>
                            case Key_3 is
                                when F16 =>
                                    Editor.Region.Justify;
                                when others =>
                                    Key;
                            end case;

                        when others =>
                            case Key_3 is
                                when others =>
                                    Key;
                            end case;
                    end case;


                when Window =>  
                    case Key_2 is
                        when '!' | '1' =>
                            Editor.Window.Expand (Lines => 3);
                        when '.' | '>' =>
                            Editor.Window.Expand (Lines => -3);

                        when '2' =>
                            Editor.Window.Frames (2);
                        when '3' =>
                            Editor.Window.Frames (3);
                        when '4' =>
                            Editor.Window.Frames (4);
                        when '5' =>
                            Editor.Window.Frames (5);

                        when '?' | '/' =>
                            Editor.Window.Directory;
                        when F10 =>
                            Editor.Window.Directory;
                        when 'c' | 'C' =>
                            Editor.Window.Copy;
                        when 'd' | 'D' | 'k' | 'K' =>
                            Editor.Window.Delete;
                        when 'j' | 'J' =>
                            Editor.Window.Join (1);
                        when 't' | 'T' =>
                            Editor.Window.Transpose;
                        when 'x' | 'X' =>
                            Editor.Window.Delete;
                        when Delete =>
                            Editor.Window.Join (-1);
                        when Begin_Of =>
                            Editor.Window.Beginning_Of;
                        when End_Of =>
                            Editor.Window.End_Of;
                        when Left =>
                            Editor.Window.Parent;
                        when Right =>
                            Editor.Window.Child;
                        when Up =>
                            Editor.Window.Previous;
                        when Down =>
                            Editor.Window.Next;
                        when F16 =>
                            Editor.Window.Promote;

                        when F13 =>
                            case Key_3 is
                                when '~' =>
                                    Editor.Window.Demote;
                                when others =>
                                    Key;
                            end case;

                        when F17 =>
                            case Key_3 is
                                when '~' =>
                                    Editor.Window.Focus;
                                when others =>
                                    Key;
                            end case;

                        when Numeric_1 =>
                            case Key_3 is
                                when F13 =>
                                    case Key_4 is  
                                        when '~' =>
                                            Editor.Window.Demote;
                                        when others =>
                                            Key;
                                    end case;
                                when others =>
                                    Key;
                            end case;

                        when others =>
                            case Key_3 is
                                when others =>
                                    Key;
                            end case;  
                    end case;


                when Image =>
                    case Key_2 is
                        when End_Of =>
                            Editor.Image.End_Of;
                        when Down =>
                            Editor.Image.Down;
                        when Begin_Of =>
                            Editor.Image.Beginning_Of;
                        when Left =>
                            Editor.Image.Left;
                        when Right =>
                            Editor.Image.Right;
                        when Up =>
                            Editor.Image.Up;
                        when 'I' | 'i' =>
                            Editor.Set.Insert_Mode (True);
                        when 'O' | 'o' =>
                            Editor.Set.Insert_Mode (False);
                        when 'F' | 'f' =>
                            Editor.Set.Fill_Mode (True);
                        when 'X' | 'x' =>
                            Editor.Set.Fill_Mode (False);
                        when '?' | '/' =>
                            Editor.Image.Find ("");
                        when others =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;
                    end case;

                when Pf1 =>
                    Key;

                when Pf2 =>
                    Key;

                when Pf3 =>
                    case Key_2 is
                        when Up =>
                            Editor.Search.Previous;
                        when Down =>
                            Editor.Search.Next;
                        when others =>
                            Key;
                    end case;

                when Pf4 =>
                    case Key_2 is
                        when Up =>
                            Editor.Search.Replace_Previous;
                        when Down =>
                            Editor.Search.Replace_Next;  
                        when others =>
                            Key;
                    end case;

                when Line =>
                    case Key_2 is
                        when '<' | ',' =>
                            Editor.Line.Lower_Case;
                        when '>' | '.' =>
                            Editor.Line.Upper_Case;
                        when '?' | '/' =>
                            What.Line;
                        when Begin_Of =>
                            Editor.Line.Beginning_Of;
                        when 'c' | 'C' =>
                            Editor.Line.Copy;
                        when 'd' | 'D' =>
                            Editor.Line.Delete;
                        when End_Of =>
                            Editor.Line.End_Of;
                        when 'i' | 'I' =>
                            Editor.Line.Insert;
                        when 'j' | 'J' =>
                            Editor.Line.Join;
                        when 'k' | 'K' =>
                            Editor.Line.Delete_Forward;
                        when 'o' | 'O' =>
                            Editor.Line.Open;
                        when 't' | 'T' =>
                            Editor.Line.Transpose;
                        when '^' | '6' =>
                            Editor.Line.Capitalize;
                        when Delete =>
                            Editor.Line.Delete_Backward;
                        when '$' | '4' =>
                            Editor.Line.Center;
                        when Up =>
                            Editor.Cursor.Up;
                        when Down =>
                            Editor.Cursor.Down;
                        when others =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;
                    end case;

                when Word =>
                    case Key_2 is
                        when '<' | ',' =>
                            Editor.Word.Lower_Case;
                        when '>' | '.' =>
                            Editor.Word.Upper_Case;
                        when 'd' | 'D' =>
                            Editor.Word.Delete;
                        when 'K' | 'k' =>
                            Editor.Word.Delete_Forward;
                        when 't' | 'T' =>
                            Editor.Word.Transpose;
                        when '^' | '6' =>
                            Editor.Word.Capitalize;
                        when Delete =>
                            Editor.Word.Delete_Backward;
                        when End_Of =>
                            Editor.Word.End_Of;
                        when Begin_Of =>
                            Editor.Word.Beginning_Of;
                        when Left =>
                            Editor.Word.Previous;
                        when Right =>
                            Editor.Word.Next;
                        when others =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;
                    end case;


                when Mark =>
                    case Key_2 is
                        when 'r' | 'R' =>
                            Editor.Mark.Rotate;
                        when 't' | 'T' =>
                            Editor.Mark.Swap;
                        when 'p' | 'P' =>
                            Editor.Mark.Copy_Top;
                        when Delete =>
                            Editor.Mark.Delete_Top;
                        when Down =>
                            Editor.Mark.Push;
                        when Right =>
                            Editor.Mark.Next;
                        when Left =>
                            Editor.Mark.Previous;
                        when Up =>
                            Editor.Mark.Top;
                        when Begin_Of | '[' | '{' =>
                            Editor.Macro.Start;
                        when End_Of | ']' | '}' =>
                            Editor.Macro.Finish;

                        when F16 | Enter =>
                            Editor.Macro.Execute;

                        when F10 =>
                            Editor.Macro.Bind;
                        when others =>
                            case Key_3 is
                                when '~' =>
                                    Key;
                                when others =>
                                    Key;
                            end case;
                    end case;

                when others =>
                    case Key_2 is
                        when '~' =>
                            Key;
                        when others =>
                            Key;
                    end case;
            end case;


    end case;
end Vt220_Commands;