
"   TERMINAL DEFINITION FILE FOR TEKTRONIX T4115 TERMINAL
"      NOS/VE VERSION
"
"   Copyright Control Data Systems Inc. 1992
"
"   AUTHOR: Kirk M. Hoaglund
"           CIM Division
"           AHS225
"           (612) 482-6055
"
"   TO COMPILE: /deft tek4115 b=tek_4115
"
"   TO COMPILE: /deft tek4115 b=tek_4115
"
"   TO USE:     /setpa al=tek_4115
"               /setta tm=tek_4115
"
"
"
"   Keys are defined as:
"
"   SHIFTED and NORMAL:
"
"      s1     s2     s3     s4         s5     s6     s7     s8
"   +------+------+------+------+   +------+------+------+------+
"   |  F1  |  F2  |  F3  |  F4  |   |  F5  |  F6  |  F7  |  F8  |  SHIFT
"   |  f1  |  f2  |  f3  |  f4  |   |  f5  |  f6  |  f7  |  f8  |  normal
"   +------+------+------+------+   +------+------+------+------+
"      f1     f2     f3     f4         f5     f6     f7     f8
"
"   CAUTION: Only F1-F8 and S1-S8 are supported for a total of
"            Sixteen function keys including shifting

"                           CONTROL:
"                           +------+------+------+------+
"                           | bkw  | home | InsC | DelC |
"                           |  Q   |  W   |  E   |  R   |
"                           ++-----++-----++-----++-----++
"  Standard Keys and         | left | down |  up  |right |
"       Cursor control       |  A   |  S   |  D   |  F   |
"                            ++-----++-----++-----++-----++
"                             | fwd  | edit | InsL | DelL |
"                             |  Z   |  X   |  C   |  V   |
"                             +------+------+------+------+
"
"
"   MISC. VARIABLES

    csi                 = ( esc '[' )
    function            = ( esc 'O' )
    extra_func          = ( esc 'P' )
    select_code_tek     = ( esc '%!0' )
    select_code_ansi    = ( esc '%!1' )
    int_32              = ( 'B0' )
    int_34              = ( 'B2' )
    int_64              = ( 'D0' )
    int_80              = ( 'E0' )
    int_100             = ( 'F4' )
    int_160             = ( 'J0' )

"   KEYBOARD MACRO CONTROL CODES

"      FUNCTION KEY KEYCODES
"              unshifted

    int_f1              = ( 'H0' )
    int_f2              = ( 'H1' )
    int_f3              = ( 'H2' )
    int_f4              = ( 'H3' )
    int_f5              = ( 'H4' )
    int_f6              = ( 'H5' )
    int_f7              = ( 'H6' )
    int_f8              = ( 'H7' )

"              shifted

    int_f1_s            = ( 'H8' )
    int_f2_s            = ( 'H9' )
    int_f3_s            = ( 'H:' )
    int_f4_s            = ( 'H;' )
    int_f5_s            = ( 'H<' )
    int_f6_s            = ( 'H=' )
    int_f7_s            = ( 'H>' )
    int_f8_s            = ( 'H?' )

"     CURSOR CONTROL AND STANDARD KEY CODES

    int_q_c             = ( 'A1' )
    int_w_c             = ( 'A7' )
    int_e_c             = ( '5'  )
    int_r_c             = ( 'A2' )
    int_a_c             = ( '1'  )
    int_s_c             = ( 'A3' )
    int_d_c             = ( '4'  )
    int_f_c             = ( '6'  )
    int_z_c             = ( 'A:' )
    int_x_c             = ( 'A8' )
    int_c_c             = ( '3'  )
    int_v_c             = ( 'A6' )

"      MISC. KEY CODES

    int_tab_s           = ( 'B.' )

"      TEK INT CODES FOR VARIOUS CHARACTER SEQUENCES

    int_esc             = ( 'A;' )
    int_cr              = ( '=' )
    int_csi             = ( int_esc 'E;' )
    int_ch_4            = ( 'C4' )
    int_EP              = ( 'B1' )
    int_AT              = ( 'D0' )
    int_PS              = ( 'B3' )
    int_DS              = ( 'B4' )
    int_PC              = ( 'B5' )
    int_UA              = ( 'E>' )
    int_GT              = ( 'C>' )
    int_dot             = ( 'B>' )
    int_star            = ( 'B:' )
    int_A               = ( 'D1' )
    int_B               = ( 'D2' )
    int_C               = ( 'D3' )
    int_D               = ( 'D4' )
    int_E               = ( 'D5' )
    int_F               = ( 'D6' )
    int_G               = ( 'D7' )
    int_H               = ( 'D8' )
    int_I               = ( 'D9' )
    int_J               = ( 'D:' )
    int_K               = ( 'D;' )
    int_L               = ( 'D<' )
    int_M               = ( 'D=' )
    int_N               = ( 'D>' )
    int_O               = ( 'D?' )
    int_P               = ( 'E0' )
    int_Z               = ( 'E:' )
    int_l_a             = ( 'F1' )
    int_l_b             = ( 'F2' )
    int_l_c             = ( 'F3' )
    int_l_d             = ( 'F4' )
    int_l_e             = ( 'F5' )
    int_l_f             = ( 'F6' )
    int_l_g             = ( 'F7' )
    int_l_h             = ( 'F8' )
    int_l_i             = ( 'F9' )
    int_l_j             = ( 'F:' )
    int_l_k             = ( 'F;' )
    int_l_l             = ( 'F<' )
    int_l_m             = ( 'F=' )
    int_l_n             = ( 'F>' )
    int_l_o             = ( 'F?' )
    int_l_p             = ( 'G0' )
    int_0               = ( 'C0' )
    int_1               = ( 'C1' )
    int_2               = ( 'C2' )
    int_3               = ( 'C3' )
    int_4               = ( 'C4' )
    int_5               = ( 'C5' )
    int_6               = ( 'C6' )
    int_7               = ( 'C7' )
    int_8               = ( 'C8' )
    int_9               = ( 'C9' )

"      SENDING SEQUENCES

    define_macro        = ( esc 'KD' )
    clear_all_macros    = ( define_macro '!0' )

    set_small_screen    = ( select_code_tek esc '8' ..
                            esc 'LB' int_34 esc 'LL' int_34 ..
                            esc 'LC' int_80 esc 'LV1' select_code_ansi )

    set_large_screen    = ( select_code_tek esc ';' ..
                            esc 'LB' int_64 esc 'LL' int_64 ..
                            esc 'LC' int_160 esc 'LV1' select_code_ansi )

    start_alternate     = ( csi '1m' )
    stop_alternate      = ( csi 'm' )
    start_inverse       = ( csi '7m' )
    stop_inverse        = ( csi 'm' )
    start_underline     = ( csi '4m' )
    stop_underline      = ( csi 'm' )
    start_blink         = ( csi '5m')
    stop_blink          = ( csi 'm')

    forward_tab         = ( 09(16) )
    backward_tab        = ( csi 'Z' )
    clear_all_tabs      = ( csi '3g' )
    set_tab             = ( esc 'H' )

    set_table_1         = ( esc 'KT4' esc 'TM111' esc 'RD14' esc 'RI211' ..
                            esc 'TG1A4' )
    set_table_2         = ( '0' '0'     '0'     '0'     ..
                            '1' int_100 int_100 int_100 )
    set_table_3         = ( '2' int_100 '0'     '0'     ..
                            '3' '0'     int_100 '0'     ..
                            '4' '0'     '0'     int_100 )
    set_color_table     = ( set_table_1 set_table_2 set_table_3 )

    set_alpha_cursor    = ( esc 'TD31' )


"     FUNCTION KEY PROGRAM MACROS
"     Tek function keys: unshifted F1..F8      are F1..F8
"                          shifted F1..F8      are shift F1..F8

    macro_f1    = ( define_macro int_f1  '4' int_esc int_O int_A int_cr )
    macro_f2    = ( define_macro int_f2  '4' int_esc int_O int_B int_cr )
    macro_f3    = ( define_macro int_f3  '4' int_esc int_O int_C int_cr )
    macro_f4    = ( define_macro int_f4  '4' int_esc int_O int_D int_cr )
    macro_f5    = ( define_macro int_f5  '4' int_esc int_O int_E int_cr )
    macro_f6    = ( define_macro int_f6  '4' int_esc int_O int_F int_cr )
    macro_f7    = ( define_macro int_f7  '4' int_esc int_O int_G int_cr )
    macro_f8    = ( define_macro int_f8  '4' int_esc int_O int_H int_cr )
    macro_f1_s  = ( define_macro int_f1_s  '4' int_esc int_O int_l_a int_cr )
    macro_f2_s  = ( define_macro int_f2_s  '4' int_esc int_O int_l_b int_cr )
    macro_f3_s  = ( define_macro int_f3_s  '4' int_esc int_O int_l_c int_cr )
    macro_f4_s  = ( define_macro int_f4_s  '4' int_esc int_O int_l_d int_cr )
    macro_f5_s  = ( define_macro int_f5_s  '4' int_esc int_O int_l_e int_cr )
    macro_f6_s  = ( define_macro int_f6_s  '4' int_esc int_O int_l_f int_cr )
    macro_f7_s  = ( define_macro int_f7_s  '4' int_esc int_O int_l_g int_cr )
    macro_f8_s  = ( define_macro int_f8_s  '4' int_esc int_O int_l_h int_cr )

"     CURSOR CONTROL AND STANDARD KEY MACROS

    macro_q_c        = (define_macro int_q_c '4' int_esc int_P int_4 int_cr)
    macro_w_c        = (define_macro int_w_c '3' int_csi int_H)
    macro_e_c        = (define_macro int_e_c '3' int_csi int_AT)
    macro_r_c        = (define_macro int_r_c '3' int_csi int_P)
    macro_a_c        = (define_macro int_a_c '3' int_csi int_D)
    macro_s_c        = (define_macro int_s_c '3' int_csi int_B)
    macro_d_c        = (define_macro int_d_c '3' int_csi int_A)
    macro_f_c        = (define_macro int_f_c '3' int_csi int_C)
    macro_z_c        = (define_macro int_z_c '4' int_esc int_P int_1 int_cr)
    macro_x_c        = (define_macro int_x_c '4' int_esc int_P int_0 int_cr)
    macro_c_c        = (define_macro int_c_c '3' int_csi int_L)
    macro_v_c        = (define_macro int_v_c '3' int_csi int_M)


"     OTHER KEY PROGRAM MACROS

    macro_tab_s      = (define_macro int_tab_s '3' int_csi int_Z)


"     MODE CHANGE CHARACTER SEQUENCES

    init_tek  = ( esc 'SK!' esc 'SV!0' esc 'KF0' esc 'KA1' esc 'LI100' ..
                  esc 'LS1' esc 'LM0' esc 'LV1' esc 'LJ3' )

    init_ansi = ( select_code_ansi csi '?8h' csi '4l' csi '2l' csi '20l' ..
                  esc ')3' )


"   MODEL NAME AND COMMUNICATION TYPE

    model_name          value = 'TEK_4115'
    communications      type  = asynch

"   END OF INFORMATION SPECIFICATION

    end_of_information  in    = (0)

"   CURSOR POSITIONING INFORMATION

    cursor_pos_encoding      bias  = (1)   type = ansi_cursor

"NOS: cursor_pos_encoding      bias  = (0)   type = ansi_cursor

    cursor_pos_column_first  value = FALSE
    cursor_pos_column_length value = (0)
    cursor_pos_row_length    value = (0)
    cursor_pos_begin         out   = (csi)
    cursor_pos_second        out   = (';')
    cursor_pos_third         out   = ('H')

"   CURSOR MOVEMENT INFORMATION

    cursor_home              inout = (csi 'H')  label = ('Cursor Home')
    cursor_up                inout = (csi 'A')  label = ('Cursor Up')
    cursor_down              inout = (csi 'B')  label = ('Cursor Down')
    cursor_left              inout = (csi 'D')  label = ('Cursor Left')
    cursor_right             inout = (csi 'C')  label = ('Cursor Right')

"   CURSOR BEHAVIOR (for cursor movement keys)

    move_past_right          type  = stop_next
    move_past_left           type  = stop_next
    move_past_top            type  = stop_next
    move_past_bottom         type  = stop_next

"   CURSOR BEHAVIOR (for character keys)

    char_past_right          type  = stop_next
    char_past_left           type  = stop_next
    char_past_last_position  type  = stop_next

"   TERMINAL ATTRIBUTES

    function_key_leaves_mark value = 1

"NOS: function_key_leaves_mark value = TRUE

    automatic_tabbing        value = FALSE
    clears_when_change_size  value = TRUE
    has_hidden               value = FALSE
    has_protect              value = FALSE
    home_at_top              value = TRUE
    multiple_sizes           value = FALSE
    tabs_to_home             value = FALSE
    tabs_to_tab_stops        value = TRUE
    tabs_to_unprotected      value = FALSE
    type_ahead               value = TRUE

"   SCREEN SIZES

    set_size       rows = 34 columns =  80   out = (set_small_screen)
    set_size       rows = 64 columns = 160   out = (set_large_screen)

"   SCREEN AND LINE MODE TRANSITION

    screen_init      out =    ( select_code_tek )
    screen_init      out =    ( set_color_table )
    screen_init      out =    ( set_alpha_cursor)
    screen_init      out =    ( init_tek    )
    screen_init      out =    ( macro_f1    )
    screen_init      out =    ( macro_f2    )
    screen_init      out =    ( macro_f3    )
    screen_init      out =    ( macro_f4    )
    screen_init      out =    ( macro_f5    )
    screen_init      out =    ( macro_f6    )
    screen_init      out =    ( macro_f7    )
    screen_init      out =    ( macro_f8    )
    screen_init      out =    ( macro_f1_s  )
    screen_init      out =    ( macro_f2_s  )
    screen_init      out =    ( macro_f3_s  )
    screen_init      out =    ( macro_f4_s  )
    screen_init      out =    ( macro_f5_s  )
    screen_init      out =    ( macro_f6_s  )
    screen_init      out =    ( macro_f7_s  )
    screen_init      out =    ( macro_f8_s  )
    screen_init      out =    ( macro_q_c   )
    screen_init      out =    ( macro_w_c   )
    screen_init      out =    ( macro_e_c   )
    screen_init      out =    ( macro_r_c   )
    screen_init      out =    ( macro_a_c   )
    screen_init      out =    ( macro_s_c   )
    screen_init      out =    ( macro_d_c   )
    screen_init      out =    ( macro_f_c   )
    screen_init      out =    ( macro_z_c   )
    screen_init      out =    ( macro_x_c   )
    screen_init      out =    ( macro_c_c   )
    screen_init      out =    ( macro_v_c   )
    screen_init      out =    ( macro_tab_s )
    screen_init      out =    ( init_ansi )

    set_line_mode    out =    ( stop_underline )
    line_init        out =    ( select_code_tek clear_all_macros )

    set_screen_mode  out =    ( select_code_tek set_color_table ..
                                init_tek set_small_screen ..
                                init_ansi clear_all_tabs )


"   TERMINAL CAPABILITIES

    backspace           in    = (08(16))
    delete_char         inout = (csi 'P')     label='keypad 6'
    insert_char         inout = (csi '@')     label='keypad 3'
    insert_line_stay    inout = (csi 'L' )    label='keypad enter'
    delete_line_stay    inout = (csi 'M' )    label='keypad comma'
    erase_line_stay     inout = (csi '2K')
    erase_page_stay     inout = (csi '2J')
    erase_end_of_page   inout = (csi 'J')
    erase_end_of_line   inout = (csi 'K' )
    insert_mode_begin   inout = (csi '4h')
    insert_mode_end     inout = (csi '4l')
    tab_forward         inout = (forward_tab)
    tab_backward        inout = (backward_tab)
    tab_clear_all       inout = (clear_all_tabs)
    tab_set             inout = (set_tab)

"   MISCELLANEOUS TERMINAL SEQUENCES

    bell_nak            out = (bel bel)
    output_begin        out = ( )

"   PROGRAMMABLE FUNCTION KEY INPUT INFORMATION

    f1        in = (function 'A')     label = ('f1')
    f2        in = (function 'B')     label = ('f2')
    f3        in = (function 'C')     label = ('f3')
    f4        in = (function 'D')     label = ('f4')
    f5        in = (function 'E')     label = ('f5')
    f6        in = (function 'F')     label = ('f6')
    f7        in = (function 'G')     label = ('f7')
    f8        in = (function 'H')     label = ('f8')
    f1_s      in = (function 'a')     label = ('s1')
    f2_s      in = (function 'b')     label = ('s2')
    f3_s      in = (function 'c')     label = ('s3')
    f4_s      in = (function 'd')     label = ('s4')
    f5_s      in = (function 'e')     label = ('s5')
    f6_s      in = (function 'f')     label = ('s6')
    f7_s      in = (function 'g')     label = ('s7')
    f8_s      in = (function 'h')     label = ('s8')

"   CDC STANDARD FUNCTION KEY INPUT INFORMATION

    next      in = 13  label='NEXT'
    data      in = (extra_func '8')   label = ('Data')
    data_s    in = ()                 label = ('UNUSED')
    back      in = (extra_func '*')   label = ('Back')
    back_s    in = ()                 label = ('UNUSED')
    help      in = (extra_func '9')   label = ('Help')
    help_s    in = (extra_func '(')   label = ('Shift-Help')
    down      in = (extra_func '2')   label = ('Down')
    down_s    in = (extra_func '@')   label = ('Shift-Down')
    up        in = (extra_func '5')   label = ('Up')
    up_s      in = (extra_func '%')   label = ('Shift-Up')
    fwd       in = (extra_func '1')   label = ('FWD')
    fwd_s     in = (extra_func '!')   label = ('Shift-FWD')
    bkw       in = (extra_func '4')   label = ('BKW')
    bkw_s     in = (extra_func '$')   label = ('Shift-BKW')
    edit      in = (extra_func '.')   label = ('Edit')
    edit_s    in = (extra_func '>')   label = ('Shift-Edit')
    stop      in = (function 'F')     label = ('f6')
    stop_s    in = (function 'f')     label = ('F6')
    undo      in = (function 'E')     label = ('f5')
    undo_s    in = (function 'e')     label = ('F5')


"   TERMINAL VIDEO ATTRIBUTES

    alt_begin           out = (start_alternate)
    alt_end             out = (stop_alternate)
    blink_begin         out = (start_blink)
    blink_end           out = (stop_blink)
    hidden_begin        out = ( )
    hidden_end          out = ( )
    inverse_begin       out = (start_inverse)
    inverse_end         out = (stop_inverse)
    underline_begin     out = (start_underline start_alternate)
    underline_end       out = (stop_alternate stop_underline)

"   LOGICAL ATTRIBUTE SPECIFICATIONS

    error_begin         out = (start_underline start_inverse)
    error_end           out = (stop_inverse stop_underline)
    input_text_begin    out = (start_underline start_alternate)
    input_text_end      out = (stop_alternate stop_underline)
    italic_begin        out = (start_alternate start_inverse)
    italic_end          out = (stop_inverse stop_alternate)


"   LINE DRAWING CHARACTER SPECIFICATION

   ld_fine_begin            out = (   )
   ld_fine_end              out = (   )
   ld_fine_horizontal       out = ('-')
   ld_fine_vertical         out = ('|')
   ld_fine_upper_left       out = ('+')
   ld_fine_upper_right      out = ('+')
   ld_fine_lower_left       out = ('+')
   ld_fine_lower_right      out = ('+')
   ld_fine_up_t             out = ('+')
   ld_fine_down_t           out = ('+')
   ld_fine_left_t           out = ('+')
   ld_fine_right_t          out = ('+')
   ld_fine_cross            out = ('+')
   ld_medium_begin          out = (start_alternate)
   ld_medium_end            out = (stop_alternate)
   ld_medium_horizontal     out = ('#')
   ld_medium_vertical       out = ('#')
   ld_medium_upper_left     out = ('#')
   ld_medium_upper_right    out = ('#')
   ld_medium_lower_left     out = ('#')
   ld_medium_lower_right    out = ('#')
   ld_medium_up_t           out = ('#')
   ld_medium_down_t         out = ('#')
   ld_medium_left_t         out = ('#')
   ld_medium_right_t        out = ('#')
   ld_medium_cross          out = ('#')
   ld_bold_begin            out = (start_inverse)
   ld_bold_end              out = (stop_inverse)
   ld_bold_horizontal       out = (' ')
   ld_bold_vertical         out = (' ')
   ld_bold_upper_left       out = (' ')
   ld_bold_upper_right      out = (' ')
   ld_bold_lower_left       out = (' ')
   ld_bold_lower_right      out = (' ')
   ld_bold_up_t             out = (' ')
   ld_bold_down_t           out = (' ')
   ld_bold_left_t           out = (' ')
   ld_bold_right_t          out = (' ')
   ld_bold_cross            out = (' ')


"   END OF TERMINAL DEFINITION FILE FOR TEKTRONIX T4115 TERMINAL
