keyboard.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. ///////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/msw/private/keyboard.h
  3. // Purpose: Helper keyboard-related functions.
  4. // Author: Vadim Zeitlin
  5. // Created: 2010-09-09
  6. // Copyright: (c) 2010 Vadim Zeitlin <vadim@wxwidgets.org>
  7. // Licence: wxWindows licence
  8. ///////////////////////////////////////////////////////////////////////////////
  9. #ifndef _WX_MSW_PRIVATE_KEYBOARD_H_
  10. #define _WX_MSW_PRIVATE_KEYBOARD_H_
  11. #include "wx/defs.h"
  12. namespace wxMSWKeyboard
  13. {
  14. // ----------------------------------------------------------------------------
  15. // Functions for translating between MSW virtual keys codes and wx key codes
  16. //
  17. // These functions are currently implemented in src/msw/window.cpp.
  18. // ----------------------------------------------------------------------------
  19. // Translate MSW virtual key code to wx key code. lParam is used to distinguish
  20. // between numpad and extended version of the keys, extended is assumed by
  21. // default if lParam == 0.
  22. //
  23. // Returns WXK_NONE if translation couldn't be done at all (this happens e.g.
  24. // for dead keys and in this case uc will be WXK_NONE too) or if the key
  25. // corresponds to a non-Latin-1 character in which case uc is filled with its
  26. // Unicode value.
  27. WXDLLIMPEXP_CORE int VKToWX(WXWORD vk, WXLPARAM lParam = 0, wchar_t *uc = NULL);
  28. // Translate wxKeyCode enum element (passed as int for compatibility reasons)
  29. // to MSW virtual key code. isExtended is set to true if the key corresponds to
  30. // a non-numpad version of a key that exists both on numpad and outside it.
  31. WXDLLIMPEXP_CORE WXWORD WXToVK(int id, bool *isExtended = NULL);
  32. } // namespace wxMSWKeyboard
  33. #endif // _WX_MSW_PRIVATE_KEYBOARD_H_