home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / Libraries / Aidan's Class Libraries / Source / Headers / CLKeyboardHandler.h < prev    next >
Encoding:
Text File  |  1997-05-24  |  781 b   |  33 lines  |  [TEXT/CWIE]

  1. //Copyright (c) 1997 Aidan Cully
  2. //All rights reserved.
  3.  
  4. #ifndef __KEYBOARDHANDLER_H
  5. #define __KEYBOARDHANDLER_H
  6.  
  7. #include "CLDeviceHandler.h"
  8. #include "CLKeyboardListener.h"
  9. #include "CLList.h"
  10.  
  11. class TKeyboardHandler:
  12.     public TDeviceHandler
  13. {
  14. private:
  15.     TList<MKeyboardListener*> mhListeners;
  16.     static TKeyboardHandler *shKeyboard;
  17.     UINT16 mModifiers;
  18. protected:
  19.     void BuildEvent( const EventRecord& );
  20. public:
  21.     TKeyboardHandler();
  22.     virtual void NewDispatcher();
  23.     virtual void OldDispatcher();
  24.     virtual void DispatchEvent( const EventRecord& );
  25.     void SetListener( MKeyboardListener* );
  26.     MKeyboardListener *GetListener();
  27.     static TKeyboardHandler *GetKeyboard();
  28.     UINT16 GetModifiers() {return( mModifiers );};
  29.     friend class MEventDispatcher;
  30.     Boolean IsKeyDown( UINT8 );
  31. };
  32.  
  33. #endif