X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/54a9471afb63d1c1caee36bc58e45f79f12e9f68..b50d93d1dae385443f0ca4a57736cb5a57a3e7fe:/include/wx/event.h diff --git a/include/wx/event.h b/include/wx/event.h index de71cd631d..6be32bc266 100644 --- a/include/wx/event.h +++ b/include/wx/event.h @@ -560,7 +560,7 @@ private: // Create functors for the templatized events, either allocated on the heap for // wxNewXXX() variants (this is needed in wxEvtHandler::Bind<>() to store them -// in dynamic event table) or just by returning them as a temporary objects (this +// in dynamic event table) or just by returning them as temporary objects (this // is enough for Unbind<>() and we avoid unnecessary heap allocation like this). @@ -1069,7 +1069,7 @@ public: wxPropagateOnce(wxEvent& event) : m_event(event) { wxASSERT_MSG( m_event.m_propagationLevel > 0, - _T("shouldn't be used unless ShouldPropagate()!") ); + wxT("shouldn't be used unless ShouldPropagate()!") ); m_event.m_propagationLevel--; } @@ -1504,6 +1504,33 @@ private: wxEVT_HOTKEY */ +// key categories: the bit flags for IsKeyInCategory() function +// +// the enum values used may change in future version of wx +// use the named constants only, or bitwise combinations thereof +enum wxKeyCategoryFlags +{ + // arrow keys, on and off numeric keypads + WXK_CATEGORY_ARROW = 1, + + // page up and page down keys, on and off numeric keypads + WXK_CATEGORY_PAGING = 2, + + // home and end keys, on and off numeric keypads + WXK_CATEGORY_JUMP = 4, + + // tab key, on and off numeric keypads + WXK_CATEGORY_TAB = 8, + + // backspace and delete keys, on and off numeric keypads + WXK_CATEGORY_CUT = 16, + + // all keys usually used for navigation + WXK_CATEGORY_NAVIGATION = WXK_CATEGORY_ARROW | + WXK_CATEGORY_PAGING | + WXK_CATEGORY_JUMP +}; + class WXDLLIMPEXP_CORE wxKeyEvent : public wxEvent, public wxKeyboardState { @@ -1514,6 +1541,9 @@ public: // get the key code: an ASCII7 char or an element of wxKeyCode enum int GetKeyCode() const { return (int)m_keyCode; } + // returns true iff this event's key code is of a certain type + bool IsKeyInCategory(int category) const; + #if wxUSE_UNICODE // get the Unicode character corresponding to this key wxChar GetUnicodeKey() const { return m_uniChar; } @@ -1917,7 +1947,7 @@ public: // m_loggingOff flag is only used by wxEVT_[QUERY_]END_SESSION, it // doesn't make sense for wxEVT_CLOSE_WINDOW wxASSERT_MSG( m_eventType != wxEVT_CLOSE_WINDOW, - _T("this flag is for end session events only") ); + wxT("this flag is for end session events only") ); return m_loggingOff; }