+ You may discover how the other keys on your system behave
+ interactively by running the KeyEvents sample in the wxPython demo and
+ pressing some keys while the blue box at the top has the keyboard
+ focus.
+
+ **Note**: If a key down event is caught and the event handler does not
+ call event.Skip() then the coresponding char event will not
+ happen. This is by design and enables the programs that handle both
+ types of events to be a bit simpler.
+
+ **Note for Windows programmers**: The key and char events in wxWidgets
+ are similar to but slightly different from Windows WM_KEYDOWN and
+ WM_CHAR events. In particular, Alt-x combination will generate a char
+ event in wxWidgets (unless it is used as an accelerator).
+
+ **Tip**: be sure to call event.Skip() for events that you don't
+ process in key event function, otherwise menu shortcuts may cease to
+ work under Windows.
+
+ """
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
+ __repr__ = _swig_repr
+ def __init__(self, *args, **kwargs):
+ """
+ __init__(self, EventType eventType=wxEVT_NULL) -> KeyEvent
+
+ Construct a new `wx.KeyEvent`. Valid event types are:
+ *
+ """
+ _core_.KeyEvent_swiginit(self,_core_.new_KeyEvent(*args, **kwargs))
+ def GetModifiers(*args, **kwargs):
+ """
+ GetModifiers(self) -> int
+
+ Returns a bitmask of the current modifier settings. Can be used to
+ check if the key event has exactly the given modifiers without having
+ to explicitly check that the other modifiers are not down. For
+ example::
+
+ if event.GetModifers() == wx.MOD_CONTROL:
+ DoSomething()
+
+ """
+ return _core_.KeyEvent_GetModifiers(*args, **kwargs)
+
+ def ControlDown(*args, **kwargs):
+ """
+ ControlDown(self) -> bool
+
+ Returns ``True`` if the Control key was down at the time of the event.
+ """
+ return _core_.KeyEvent_ControlDown(*args, **kwargs)
+
+ def MetaDown(*args, **kwargs):
+ """
+ MetaDown(self) -> bool
+
+ Returns ``True`` if the Meta key was down at the time of the event.
+ """
+ return _core_.KeyEvent_MetaDown(*args, **kwargs)
+
+ def AltDown(*args, **kwargs):
+ """
+ AltDown(self) -> bool
+
+ Returns ``True`` if the Alt key was down at the time of the event.
+ """
+ return _core_.KeyEvent_AltDown(*args, **kwargs)
+
+ def ShiftDown(*args, **kwargs):
+ """
+ ShiftDown(self) -> bool
+
+ Returns ``True`` if the Shift key was down at the time of the event.
+ """
+ return _core_.KeyEvent_ShiftDown(*args, **kwargs)
+
+ def CmdDown(*args, **kwargs):
+ """
+ CmdDown(self) -> bool
+
+ "Cmd" is a pseudo key which is the same as Control for PC and Unix
+ platforms but the special "Apple" (a.k.a as "Command") key on
+ 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. The Ctrl still exists, it's just not used for this
+ purpose. So for non-Mac platforms this is the same as `ControlDown`
+ and Macs this is the same as `MetaDown`.
+ """
+ return _core_.KeyEvent_CmdDown(*args, **kwargs)
+
+ def HasModifiers(*args, **kwargs):
+ """
+ HasModifiers(self) -> bool
+
+ Returns true if either CTRL or ALT keys was down at the time of the
+ key event. Note that this function does not take into account neither
+ SHIFT nor META key states (the reason for ignoring the latter is that
+ it is common for NUMLOCK key to be configured as META under X but the
+ key presses even while NUMLOCK is on should be still processed
+ normally).
+ """