You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.6 KiB

7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /* Skeleton keyboard handler routines header.
  2. Copyright (c) 2002 by Salvador E. Tropea (SET)
  3. Covered by the GPL license. */
  4. /*
  5. This header is an example that could help somebody trying to write a new
  6. driver. The word "Skeleton" should be replaced by the target i.e. the OS.
  7. */
  8. #ifndef SKELETONKEY_HEADER_INCLUDED
  9. #define SKELETONKEY_HEADER_INCLUDED
  10. // A class to encapsulate the globals, all is static!
  11. class TGKeySkeleton : public TGKey
  12. {
  13. public:
  14. // Usually nothing goes here and the initialization code goes in Init()
  15. TGKeySkeleton() {};
  16. // Function replacements
  17. // Put the keyboard in the original state
  18. static void Suspend();
  19. // Memorize current state and setup our state
  20. static void Resume();
  21. // Is a key waiting to be retreived?
  22. static int KbHit();
  23. // Remove all the keys waiting to be retrieved.
  24. static void Clear();
  25. // Get the next key. The format is the one you can see in tkeyext.h and
  26. // gkey.h
  27. static ushort GKey();
  28. // What's the current state of modifier keys. The IBM BIOS values are used.
  29. // Not all targets implement it.
  30. static unsigned GetShiftState();
  31. // Fill a TEvent structure with the next available key (or evNothing)
  32. static void FillTEvent(TEvent &e);
  33. // Set a particular mode requested by the user. The values should be allocated
  34. // in the keyMode enumeration found in TGKey to avoid collisions between drivers.
  35. static void SetKbdMapping(int version);
  36. // Setup the pointers to point our members
  37. static void Init();
  38. protected:
  39. // Put support routines and variables here
  40. };
  41. #endif // SKELETONKEY_HEADER_INCLUDED