home *** CD-ROM | disk | FTP | other *** search
/ HAM Radio 1 / HamRadio.cdr / cw / kamrtty / kam-kbd.pas < prev    next >
Pascal/Delphi Source File  |  1987-12-06  |  6KB  |  153 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      : begin
  35.                                     rcv_cnt := 0;
  36.                                     FillChar(rcv_buffer,$800,#32);
  37.                                   end;
  38.  { alt F6 }            #109     : save_buffer;
  39.  { shf F6              #89      : ;                            }
  40.  { ctl F6              #99      : ;                            }
  41.  
  42.  { F7     }            #65      : send_file;
  43.  { alt F7              #110     : ;                           }
  44.  { shf F7              #90      : ;                           }
  45.  { ctl F7              #100     : ;                           }
  46.  
  47.  { F8     }            #66      : begin
  48.                                     change_speed;
  49.                                     send_interrupt := TRUE;
  50.                                   end;
  51.  { alt F8              #111     : ;                           }
  52.  { shf F8              #91      : ;                           }
  53.  { ctl F8              #101     : ;                           }
  54.  
  55.  { F9  }               #67      : check_dup;
  56.  { alt F9              #112     : ;                           }
  57.  { shf F9              #92      : ;                           }
  58.  { ctl F9              #102     : ;                           }
  59.  
  60.  { F10 }               #68      : log_qso;
  61.  { alt F10 }           #113     : update_log;
  62.  { shf F10 }           #93      : view_log ;
  63.  { ctl F10             #103     : ;                           }
  64.  
  65.  { alt 0 }             #129     : xmt_msg(0);
  66.  { alt 1 }             #120     : xmt_msg(1);
  67.  { alt 2 }             #121     : xmt_msg(2);
  68.  { alt 3 }             #122     : xmt_msg(3);
  69.  { alt 4 }             #123     : xmt_msg(4);
  70.  { alt 5 }             #124     : xmt_msg(5);
  71.  { alt 6 }             #125     : xmt_msg(6);
  72.  { alt 7 }             #126     : xmt_msg(7);
  73.  { alt 8 }             #127     : xmt_msg(8);
  74.  { alt 9 }             #128     : xmt_msg(9);
  75.  
  76.  { alt A }             #30      : begin
  77.                                     auto_switch := NOT auto_switch;
  78.                                     sho_status;
  79.                                   end;
  80.  { alt B }             #48      : case mode of
  81.                                     CW    : ;
  82.                                     RTTY  : new_rtty_baud;
  83.                                     ASCII : new_rtty_baud;
  84.                                   end;
  85.  { alt C }             #46      : case capture of
  86.                                     FALSE : capture_on;
  87.                                     TRUE  : capture_off;
  88.                                   end;
  89.  { alt D }             #32      : check_dup;
  90.  { alt F }             #33      : send_file;
  91.  { alt H }             #35      : help;
  92.  { alt I }             #23      : case mode of
  93.                                     CW    : ;
  94.                                     RTTY  : flip_invert;
  95.                                     ASCII : flip_invert;
  96.                                   end;
  97.  { alt M }             #50      : begin
  98.                                     update_log;
  99.                                     new_mode;
  100.                                     clear_screen;
  101.                                   end;
  102.  { alt P }             #25      : set_parameters;
  103.  { alt Q }             #16      : qsignals;
  104.  { alt R }             #19      : rst;
  105.  { alt S }             #31      : case mode of
  106.                                     CW     : ;
  107.                                     RTTY   : new_rtty_shift;
  108.                                     ASCII  : new_rtty_shift;
  109.                                   end;
  110.  { alt X }             #45      : exit_request;
  111.  { alt W }             #17      : case mode of
  112.                                     CW     : begin
  113.                                                set_speed;
  114.                                                send_interrupt := TRUE;
  115.                                              end;
  116.                                     RTTY   : ;
  117.                                     ASCII  : ;
  118.                                   end;
  119.  { alt Y }             #21      : case mode of
  120.                                     CW     : ;
  121.                                     RTTY   : RYs;
  122.                                     ASCII  : RYs;
  123.                                   end;
  124.  
  125.   end;
  126.   rcv_interrupt := TRUE;
  127. end;
  128.  
  129. procedure chk_kbd;
  130. begin
  131.   if keypressed then
  132.   begin
  133.     qkey := readkey;
  134.     case file_mode of
  135.       true: case qkey of
  136.               ^T : case state of
  137.                      receive       : state := transmit;
  138.                      transmit      : halt_xmt;
  139.                    end;
  140.               ^P : pause_flag := true;
  141.               #0 : qkey := readkey;
  142.             end;
  143.       false: case qkey of
  144.                #0 : check_function_keys;
  145.                #8 : del_char;
  146.                #7,#13,' '..'z' : add_char(qkey);
  147.              end;
  148.     end;
  149.   end;
  150. end;
  151.  
  152.  
  153.