home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_01_02 / 1n02077a < prev    next >
Text File  |  1990-07-09  |  697b  |  30 lines

  1.  
  2. /* get_response() is the menu() and dir_menu() operator selection function */
  3. /* that returns the character selected by keyboard or the mouse selection */
  4. /* if mouse_flag is not zero */
  5.  
  6. static int get_response()
  7. {
  8.     int ret_val= -1;
  9.  
  10.     while(ret_val == -1)
  11.     {
  12.         if((mouse_flag != MOUSE_ONLY) && kbhit())
  13.         {
  14.             ret_val=getch();
  15.             if(ret_val==ALT)
  16.                 ret_val=get_extended_key();
  17.                 /* clear the keyboard buffer */
  18.             while(kbhit())
  19.                 getch();
  20.         }
  21.         else
  22.             if(mouse_flag != KEYBOARD_ONLY)
  23.                 ret_val=mouse_read();
  24.  
  25.     }
  26.     return ret_val;
  27.  
  28. }
  29.  
  30.