home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / PROG_GEN / FACETV.ZIP / KORBUTT.CPP < prev    next >
C/C++ Source or Header  |  1994-01-05  |  2KB  |  63 lines

  1. /************************************************************************
  2. **
  3. ** @(#)korbutt.cpp    01/05/94    Chris Ahlstrom
  4. **
  5. **    This module interfaces C++ with code for handling various kinds
  6. ** of button devices; the substrate is Borland's Turbo Vision.
  7. **
  8. *************************************************************************/
  9.  
  10. #define KORBUTT_cpp
  11.  
  12. #include <conio.h>        // inp() declaration
  13.  
  14. #include "korbutt.h"        // KoalaResponseButton class
  15.  
  16.  
  17. /************************************************************************
  18. ** KoalaResponseButton constructor
  19. *************************************************************************/
  20.  
  21. KoalaResponseButton::KoalaResponseButton ()
  22.   :
  23.     ResponseButton(KOALA_RESPONSE)
  24. {
  25. }
  26.  
  27.  
  28. KoalaResponseButton::~KoalaResponseButton ()
  29. {
  30. }
  31.  
  32.  
  33. /************************************************************************
  34. ** readKey() override
  35. **
  36. **    Function to read the Koala-pad buttons.
  37. **
  38. **    See the Response typedef in rbuttons.h.
  39. **
  40. *************************************************************************/
  41.  
  42. int
  43. KoalaResponseButton::readKey ()
  44. {
  45.     int button = (int) NO_BUTTON;
  46.  
  47.     button = (int) inp(GAME_PORT);        // check game port
  48.     button = BOTH_BUTTONS - ((button>>4) % 4);
  49.  
  50.     return button;
  51. }
  52.  
  53.  
  54. /************************************************************************
  55. ** waitKey()
  56. ** checkAbort()
  57. ** getLastResponse()
  58. **
  59. **    These functions don't need overriding.
  60. **
  61. *************************************************************************/
  62.  
  63.