]> git.saurik.com Git - wxWidgets.git/commitdiff
don't check for Meta key in wxKeyEvent::HasModifiers()
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 8 Oct 2001 15:58:52 +0000 (15:58 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 8 Oct 2001 15:58:52 +0000 (15:58 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11886 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/latex/wx/keyevent.tex
include/wx/event.h

index 34dfc6afd3e0b69e6dcc4bd0d305760c67d159ab..99d3386f3fe1d07a9a987258d470c89451b5d7ec 100644 (file)
@@ -131,9 +131,12 @@ Obtains the position at which the key was pressed.
 
 \constfunc{bool}{HasModifiers}{\void}
 
 
 \constfunc{bool}{HasModifiers}{\void}
 
-Returns TRUE if either of {\sc Ctrl}, {\sc Alt} or {\sc Meta} keys was down
+Returns TRUE if either {\sc Ctrl} or {\sc Alt} keys was down
 at the time of the key event. Note that this function does not take into
 at the time of the key event. Note that this function does not take into
-account the {\sc Shift} key state.
+account neither {\sc Shift} nor {\sc Meta} key states (the reason for ignoring
+the latter is that it is common for {\sc NumLock} key to be configured as 
+{\sc Meta} under X but the key presses even while {\sc NumLock} is on should
+be still processed normally).
 
 \membersection{wxKeyEvent::ShiftDown}
 
 
 \membersection{wxKeyEvent::ShiftDown}
 
index 19922acda2efd535626ede8cde57e28c7659b208..17636578447ba1444a8f7720c317e3d92989ba90 100644 (file)
@@ -780,7 +780,10 @@ public:
     bool AltDown() const { return m_altDown; }
     bool ShiftDown() const { return m_shiftDown; }
 
     bool AltDown() const { return m_altDown; }
     bool ShiftDown() const { return m_shiftDown; }
 
-    bool HasModifiers() const { return ControlDown() || AltDown() || MetaDown(); }
+    // 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
+    bool HasModifiers() const { return ControlDown() || AltDown(); }
 
     // get the key code: an ASCII7 char or an element of wxKeyCode enum
     int GetKeyCode() const { return (int)m_keyCode; }
 
     // get the key code: an ASCII7 char or an element of wxKeyCode enum
     int GetKeyCode() const { return (int)m_keyCode; }