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.

SInput.h 1.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
  2. *
  3. * This is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License as published by
  5. * the Free Software Foundation; either version 2 of the License, or
  6. * (at your option) any later version.
  7. *
  8. * This software is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this software; if not, write to the Free Software
  15. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  16. * USA.
  17. */
  18. // -=- Input.h
  19. //
  20. // A number of routines that accept VNC-style input event data and perform
  21. // the appropriate actions under Win32
  22. #ifndef __RFB_WIN32_INPUT_H__
  23. #define __RFB_WIN32_INPUT_H__
  24. #include <rfb/Rect.h>
  25. #include <rfb/Configuration.h>
  26. #include <rdr/types.h>
  27. #include <map>
  28. #include <vector>
  29. namespace rfb {
  30. namespace win32 {
  31. // -=- Pointer event handling
  32. class SPointer {
  33. public:
  34. SPointer();
  35. // - Create a pointer event at a the given coordinates, with the
  36. // specified button state. The event must be specified using
  37. // Screen coordinates.
  38. void pointerEvent(const Point& pos, int buttonmask);
  39. protected:
  40. Point last_position;
  41. rdr::U8 last_buttonmask;
  42. };
  43. // -=- Keyboard event handling
  44. class SKeyboard {
  45. public:
  46. SKeyboard();
  47. void keyEvent(rdr::U32 keysym, rdr::U32 keycode, bool down);
  48. static BoolParameter deadKeyAware;
  49. static BoolParameter rawKeyboard;
  50. private:
  51. std::map<rdr::U32,rdr::U8> vkMap;
  52. std::map<rdr::U32,bool> extendedMap;
  53. std::vector<rdr::U8> deadChars;
  54. };
  55. }; // win32
  56. }; // rfb
  57. #endif // __RFB_WIN32_INPUT_H__