home *** CD-ROM | disk | FTP | other *** search
/ HAM Radio 1 / HamRadio.cdr / misc / kam401 / kam-kbd.pas < prev    next >
Pascal/Delphi Source File  |  1989-08-25  |  8KB  |  183 lines

  1. procedure check_function_keys;
  2. begin
  3.   qkey := readkey;
  4.   case qkey of
  5.  
  6.  { F1 }                #59      : help;
  7.  { alt F1              #104     : ;                           }
  8.  { shf F               #84      : ;                           }
  9.  { ctl F1              #94      : ;                           }
  10.  
  11.  { F2     }            #60      : begin
  12.                                     clear_screen;
  13.                                     send_interrupt := TRUE;
  14.                                   end;
  15.  { alt F2              #105     : ;                            }
  16.  { shf F2              #85      : ;                            }
  17.  { ctl F2              #95      : ;                            }
  18.  
  19.  { F3     }            #61      : clear_transmit_screen;
  20.  { alt F3              #106     : ;                            }
  21.  { shf F3              #86      : ;                            }
  22.  { ctl F3              #96      : ;                            }
  23.  
  24.  { F4     }            #62      : clear_receive_screen;
  25.  { alt F4              #107     :                              }
  26.  { shf F4              #87      : ;                            }
  27.  { ctl F4              #97      : ;                            }
  28.  
  29.  { F5     }            #63      : view_modify_msgs;
  30.  { alt F5 }            #108     : load_messages;
  31.  { shf F5 }            #88      : save_messages;
  32.  { ctl F5              #98      : ;                            }
  33.  
  34.  { F6     }            #64      : save_buffer;
  35.  { alt F6              #109     : ;                            }
  36.  { shf F6              #89      : ;                            }
  37.  { ctl F6              #99      : ;                            }
  38.  
  39.  { F7     }            #65      : send_file;
  40.  { alt F7              #110     : ;                           }
  41.  { shf F7              #90      : ;                           }
  42.  { ctl F7              #100     : ;                           }
  43.  
  44.  { F8     }            #66      : if mode = CW then
  45.                                   begin
  46.                                    change_speed;
  47.                                     send_interrupt := TRUE;
  48.                                   end;
  49.  { alt F8              #111     : ;                           }
  50.  { shf F8              #91      : ;                           }
  51.  { ctl F8              #101     : ;                           }
  52.  
  53.  { F9                  #67      : ;                           }
  54.  { alt F9              #112     : ;                           }
  55.  { shf F9              #92      : ;                           }
  56.  { ctl F9              #102     : ;                           }
  57.  
  58.  { F10 }               #68      : log_qso;
  59.  { alt F10             #113     : ;                           }
  60.  { shf F10             #93      : ;                           }
  61.  { ctl F10             #103     : ;                           }
  62.  
  63.  { alt 0 }             #129     : xmt_msg(0);
  64.  { alt 1 }             #120     : xmt_msg(1);
  65.  { alt 2 }             #121     : xmt_msg(2);
  66.  { alt 3 }             #122     : xmt_msg(3);
  67.  { alt 4 }             #123     : xmt_msg(4);
  68.  { alt 5 }             #124     : xmt_msg(5);
  69.  { alt 6 }             #125     : xmt_msg(6);
  70.  { alt 7 }             #126     : xmt_msg(7);
  71.  { alt 8 }             #127     : xmt_msg(8);
  72.  { alt 9 }             #128     : xmt_msg(9);
  73.  
  74.  { alt A }             #30      : if mode in [CW, RTTY, ASCII] then
  75.                                   begin
  76.                                     auto_switch := NOT auto_switch;
  77.                                     sho_status;
  78.                                   end;
  79.  { alt B }             #48      : if mode in [RTTY, ASCII] then
  80.                                     new_rtty_baud;
  81.  { alt C }             #46      : case capture of
  82.                                     FALSE : capture_on;
  83.                                     TRUE  : capture_off;
  84.                                   end;
  85.  { alt D }             #32      : if mode = PACKET then
  86.                                     packet_disconnect;
  87.  { alt F }             #33      : send_file;
  88.  { alt H }             #35      : if mode = PACKET then
  89.                                   begin HF_Packet;
  90.                                         sho_status;
  91.                                   end;
  92.  { alt I }             #23      : case mode of
  93.                                     CW : ;
  94.                                     RTTY,ASCII : flip_invert;
  95.                                     PACKET : PacketID;
  96.                                   end;
  97.  { alt K }             #37      : if (mode = PACKET) AND
  98.                                      (PKCall <> '') then
  99.                                      packet_connect;
  100.  { alt L }             #38      : if (mode = PACKET) then
  101.                                   begin
  102.                                     MaintainCallList;
  103.                                     sho_status;
  104.                                   end;
  105.  { alt M }             #50      : begin
  106.                                     new_mode;
  107.                                     clear_screen;
  108.                                   end;
  109.  { alt P }             #25      : set_parameters;
  110.  { alt Q }             #16      : qsignals;
  111.  { alt R }             #19      : rst;
  112.  { alt S }             #31      : if mode in [RTTY,ASCII] then
  113.                                     new_rtty_shift;
  114.  { alt V }             #47      : if mode = PACKET then
  115.                                   begin VHF_Packet;
  116.                                         sho_status;
  117.                                   end;
  118.  { alt X }             #45      : exit_request;
  119.  { alt W }             #17      : if mode = CW then
  120.                                   begin
  121.                                     set_speed;
  122.                                     send_interrupt := TRUE;
  123.                                   end;
  124.  { alt Y }             #21      : if mode in [RTTY,ASCII] then
  125.                                     RYs;
  126.  { alt Z }             #44      : if mode = PACKET then
  127.                                     kam_cmd(^C);
  128.  { Page Up }           #73      : review_rcv_buffer;
  129.   end;
  130.   rcv_interrupt := TRUE;
  131. end;
  132.  
  133. procedure chk_kbd;
  134. begin
  135.   if keypressed then
  136.   begin
  137.     qkey := readkey;
  138.     case file_mode of
  139.       true: case qkey of
  140.               ^T : case state of
  141.                      receive  : state := transmit;
  142.                      transmit : halt_xmt;
  143.                      transceive : ;
  144.                    end;
  145.               #0 : qkey := readkey;
  146.             end;
  147.       false: case qkey of
  148.                #0 : check_function_keys;
  149.                ^T : case state of
  150.                       receive  : state := transmit;
  151.                       transmit : halt_xmt;
  152.                       transceive : ;
  153.                     end;
  154.                #8 : del_char;
  155.                #7,#13,' '..'z' : add_char(qkey);
  156.                ^Z : if mode = PACKET then add_char(qkey);
  157.                ^C : if mode = AMTOR then add_char(qkey);
  158.              end;
  159.     end;
  160.   if qkey = ^P then
  161.     case pause_flag of
  162.       FALSE : begin
  163.                 if mode in [ASCII,CW,RTTY] then
  164.                   state := receive;
  165.                 pause_flag := TRUE;
  166.               end;
  167.        TRUE : begin
  168.                 if mode in [ASCII,CW,RTTY] then
  169.                   state := transmit;
  170.                 pause_flag := FALSE;
  171.               end;
  172.     end;
  173.  
  174.   end;
  175.   if (mode in [CW,RTTY,ASCII]) AND
  176.      (auto_switch = TRUE)    AND
  177.      (inp_ptr <> out_ptr)        then state := transmit;
  178.  
  179. end;
  180.  
  181.  
  182.  
  183.