added and documented wxKey/MouseEvent::CmdDown()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28118 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2004-07-01 00:04:48 +00:00
parent 559b747dc0
commit a2bd152089
4 changed files with 55 additions and 4 deletions

View File

@@ -703,6 +703,14 @@ public:
bool MetaDown() const { return m_metaDown; }
bool AltDown() const { return m_altDown; }
bool ShiftDown() const { return m_shiftDown; }
bool CmdDown() const
{
#if defined(__WXMAC__) || defined(__WXCOCOA__)
return MetaDown();
#else
return ControlDown();
#endif
}
// Find which event was just generated
bool LeftDown() const { return (m_eventType == wxEVT_LEFT_DOWN); }
@@ -878,6 +886,20 @@ public:
bool AltDown() const { return m_altDown; }
bool ShiftDown() const { return m_shiftDown; }
// "Cmd" is a pseudo key which is Control for PC and Unix platforms but
// Apple ("Command") key under Macs: it makes often sense to use it instead
// of, say, ControlDown() because Cmd key is used for the same thing under
// Mac as Ctrl elsewhere (but Ctrl still exists, just not used for this
// purpose under Mac)
bool CmdDown() const
{
#if defined(__WXMAC__) || defined(__WXCOCOA__)
return MetaDown();
#else
return ControlDown();
#endif
}
// exclude MetaDown() from HasModifiers() because NumLock under X is often
// configured as mod2 modifier, yet the key events even when it is pressed
// should be processed normally, not like Ctrl- or Alt-key