X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ba4d737a9ec66377cb4a3b4224aacca8c894bbc1..438959cca892a7651634cc3a7aad4819ac49b23c:/include/wx/kbdstate.h diff --git a/include/wx/kbdstate.h b/include/wx/kbdstate.h index d2055a0c09..71e196db3c 100644 --- a/include/wx/kbdstate.h +++ b/include/wx/kbdstate.h @@ -28,6 +28,9 @@ public: m_shiftDown(shiftDown), m_altDown(altDown), m_metaDown(metaDown) +#ifdef __WXOSX__ + ,m_rawControlDown(false) +#endif { } @@ -45,14 +48,32 @@ public: return (m_controlDown ? wxMOD_CONTROL : 0) | (m_shiftDown ? wxMOD_SHIFT : 0) | (m_metaDown ? wxMOD_META : 0) | +#ifdef __WXOSX__ + (m_rawControlDown ? wxMOD_RAW_CONTROL : 0) | +#endif (m_altDown ? wxMOD_ALT : 0); } // returns true if any modifiers at all are pressed - bool HasModifiers() const { return GetModifiers() != wxMOD_NONE; } + bool HasAnyModifiers() const { return GetModifiers() != wxMOD_NONE; } + + // returns true if any modifiers changing the usual key interpretation are + // pressed, notably excluding Shift + bool HasModifiers() const + { + return ControlDown() || RawControlDown() || AltDown(); + } // accessors for individual modifier keys bool ControlDown() const { return m_controlDown; } + bool RawControlDown() const + { +#ifdef __WXOSX__ + return m_rawControlDown; +#else + return m_controlDown; +#endif + } bool ShiftDown() const { return m_shiftDown; } bool MetaDown() const { return m_metaDown; } bool AltDown() const { return m_altDown; } @@ -64,17 +85,21 @@ public: // purpose under Mac) bool CmdDown() const { -#if defined(__WXMAC__) || defined(__WXCOCOA__) - return MetaDown(); -#else return ControlDown(); -#endif } // these functions are mostly used by wxWidgets itself // --------------------------------------------------- void SetControlDown(bool down) { m_controlDown = down; } + void SetRawControlDown(bool down) + { +#ifdef __WXOSX__ + m_rawControlDown = down; +#else + m_controlDown = down; +#endif + } void SetShiftDown(bool down) { m_shiftDown = down; } void SetAltDown(bool down) { m_altDown = down; } void SetMetaDown(bool down) { m_metaDown = down; } @@ -84,10 +109,13 @@ public: // members of wxKeyEvent directly, these variables are public, however you // should not use them in any new code, please use the accessors instead public: - bool m_controlDown : 1; - bool m_shiftDown : 1; - bool m_altDown : 1; - bool m_metaDown : 1; + bool m_controlDown : 1; + bool m_shiftDown : 1; + bool m_altDown : 1; + bool m_metaDown : 1; +#ifdef __WXOSX__ + bool m_rawControlDown : 1; +#endif }; #endif // _WX_KBDSTATE_H_