home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional Developers Kit 1992 November / Disc01 / Disc01.mdf / cppbeta / ibmcli / ikeyevt.hp_ / IKEYEVT.HPP
Encoding:
C/C++ Source or Header  |  1992-10-26  |  5.1 KB  |  107 lines

  1. #ifndef _IKEYEVT_
  2. #define _IKEYEVT_
  3. /*******************************************************************************
  4. * FILE NAME: ikeyevt.hpp                                                       *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the class(es):                                              *
  8. *     IKeyboardEvent - the keyboard action information class                   *
  9. *                                                                              *
  10. * COPYRIGHT:                                                                   *
  11. *   Licensed Materials - Property of IBM                                       *
  12. *   (C) Copyright IBM Corporation 1992, 1993                                   *
  13. *   All Rights Reserved                                                        *
  14. *   US Government Users Restricted Rights - Use, duplication, or disclosure    *
  15. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  16. *                                                                              *
  17. *$Log:   R:/IBMCLASS/IBASEAPP/VCS/IKEYEVT.HPV  $                                                                         *
  18. // 
  19. //    Rev 1.4   25 Oct 1992 18:00:16   nunn
  20. // Brad Broyles changes for external beta
  21.  
  22.       Rev 1.1   01 Jan 1989 12:00:00   LM & KKL
  23.    Initiate code
  24.       Rev 1.2   01 May 1991 12:00:00   KKL
  25.    Combine all events into 1 file - modified for better performance
  26.       Rev 1.3   01 Oct 1991 12:00:00   KKL
  27.    Update per R2.0 spec.
  28.       Rev 1.4   09 Aug 1992 12:00:00   KKL
  29.    Mod. for handlers
  30.       Rev 1.5   21 Oct 1992 16:45:00   WBB
  31.    Amended to match skeleton.hpp
  32. *******************************************************************************/
  33.  
  34. // Forward declarations for other classes:
  35. class IKeyboardEvent;
  36. class IString;
  37. #if !defined( _IEVENT_ ) && !defined( I_NO_RELATED_HPP )
  38.   #include <ievent.hpp>
  39. #endif
  40.  
  41. class IKeyboardEvent : public IEvent {
  42. /*******************************************************************************
  43. * The IKeyboardEvent class provides all the keyboard action event information  *
  44. *******************************************************************************/
  45. typedef IEvent Inherited;
  46. public:
  47. /*------------------------ CONSTRUCTORS/DESTRUCTORS ----------------------------
  48. | There is one way to construct instances of this class:                       |
  49. |   1. from an instance of the IEvent class                                    |
  50. ------------------------------------------------------------------------------*/
  51.   IKeyboardEvent(IEvent& evt);
  52.  
  53. /*-------------------------------- ACCESSORS -----------------------------------
  54. | These function provide means of getting and setting the accessible           |
  55. | attributes of instances of this class:                                       |
  56. |   charCode - return the event's SBCS char value                              |
  57. |   dbcsChar - return the event's DBCS char string                             |
  58. |   repeatCount - return the number of times the character was repeated        |
  59. |   scanCode - return the keyboard raw scan code (user should verify the value |
  60. |              with isKeyCode (scanCodeIsValid)                                |
  61. ------------------------------------------------------------------------------*/
  62. char
  63.   charCode() const;
  64. IString
  65.   dbcsChar() const;
  66. unsigned long
  67.   repeatCount() const;
  68. unsigned char
  69.   scanCode() const;
  70.  
  71. /*-------------------------------- FUNCTIONS -----------------------------------
  72. | isKeyCode - is the key code condition true?                                  |
  73. | virtualKey - get the virtual key value of the key event from the virtual key |
  74. | code table (user should verify whether this value is valid with isKeyCode    |
  75. |              code table (user should verify whether this value is valid with |
  76. |              isKeyCode (virtualKeyIsValid) )                                 |
  77. ------------------------------------------------------------------------------*/
  78.   enum KeyCode { charCodeIsValid, scanCodeIsValid, virtualKeyIsValid,
  79.                  keyTransitionIsUp, keyIsRepeated, charCodeIsDeadKey,
  80.                  charCodeIsComposite, charCodeIsInvalidComposite,
  81.                  loneKeyAction, shiftKeyIsDown, altKeyIsDown,
  82.                  ctrlKeyIsDown };
  83.  
  84. Boolean
  85.   isKeyCode(KeyCode kc) const;
  86.  
  87.   enum VirtualKey
  88.    { button1, button2, button3, breakKey, backSpace, tab,
  89.      backTab, newLine, shift, ctrl, alt, altGraf, pause,
  90.      capsLock, esc, space, pageUp, pageDown, end, home,
  91.      left, up, right, down, printScreen, insert,
  92.      deleteKey, scrollLock, numLock, enter, sysRq,
  93.      f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13,
  94.      f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, f24,
  95.      endDrag, dbcsFirst, dbcsLast, userFirst, userLast };
  96.  
  97. VirtualKey
  98.   virtualKey() const;
  99. }; // IKeyboardEvent
  100.  
  101. /*--------------------------------- INLINES ----------------------------------*/
  102. #ifndef I_NO_INLINES
  103.   #include <ikeyevt.inl>
  104. #endif
  105.  
  106. #endif /* _IKEYEVT_ */
  107.