.. include:: headings.inc .. currentmodule:: lib.agw.shortcuteditor .. highlight:: python .. _lib.agw.shortcuteditor.ShortcutEvent: ========================================================================================================================================== |phoenix_title| **ShortcutEvent** ========================================================================================================================================== :class:`ShortcutEvent` is a special subclassing of :class:`PyCommandEvent`. This event gets emitted when the user is about to change a shortcut (via ``EVT_SHORTCUT_CHANGING``) and when the user has changed a shortcut (via ``EVT_SHORTCUT_CHANGED``). | |class_hierarchy| Inheritance Diagram ===================================== Inheritance diagram for class **ShortcutEvent** .. raw:: html

Inheritance diagram of ShortcutEvent

| |super_classes| Known Superclasses ================================== :class:`PyCommandEvent` | |method_summary| Methods Summary ================================ ================================================================================ ================================================================================ :meth:`~lib.agw.shortcuteditor.ShortcutEvent.__init__` Default class constructor. :meth:`~lib.agw.shortcuteditor.ShortcutEvent.GetAccelerator` Gets the shortcut string for which the operation was performed for ``EVT_SHORTCUT_CHANGED`` :meth:`~lib.agw.shortcuteditor.ShortcutEvent.GetOldAccelerator` Returns the previous shortcut string for ``EVT_SHORTCUT_CHANGED`` and :meth:`~lib.agw.shortcuteditor.ShortcutEvent.GetShortcut` Returns the shortcut class used for ``EVT_SHORTCUT_CHANGED`` and :meth:`~lib.agw.shortcuteditor.ShortcutEvent.SetAccelerator` Sets the shortcut string for which the operation was performed for ``EVT_SHORTCUT_CHANGED`` :meth:`~lib.agw.shortcuteditor.ShortcutEvent.SetOldAccelerator` Sets the previous shortcut string for ``EVT_SHORTCUT_CHANGED`` and :meth:`~lib.agw.shortcuteditor.ShortcutEvent.SetShortcut` Sets the shortcut class used for ``EVT_SHORTCUT_CHANGED`` and ================================================================================ ================================================================================ | |api| Class API =============== .. class:: ShortcutEvent(PyCommandEvent) :class:`ShortcutEvent` is a special subclassing of :class:`PyCommandEvent`. This event gets emitted when the user is about to change a shortcut (via ``EVT_SHORTCUT_CHANGING``) and when the user has changed a shortcut (via ``EVT_SHORTCUT_CHANGED``). .. method:: __init__(self, evtType, evtId, \*\*kwargs) Default class constructor. For internal use: do not call it in your code! :param integer `evtType`: the event type; :param integer `evtId`: the event identifier. .. method:: GetAccelerator(self) Gets the shortcut string for which the operation was performed for ``EVT_SHORTCUT_CHANGED`` and ``EVT_SHORTCUT_CHANGING`` events. :return: A string representing the new shortcut string (accelerator). .. method:: GetOldAccelerator(self) Returns the previous shortcut string for ``EVT_SHORTCUT_CHANGED`` and ``EVT_SHORTCUT_CHANGING`` events. :return: A string representing the old shortcut string (accelerator). .. method:: GetShortcut(self) Returns the shortcut class used for ``EVT_SHORTCUT_CHANGED`` and ``EVT_SHORTCUT_CHANGING`` events. :return: An instance of :class:`Shortcut`. .. method:: SetAccelerator(self, accelerator) Sets the shortcut string for which the operation was performed for ``EVT_SHORTCUT_CHANGED`` and ``EVT_SHORTCUT_CHANGING`` events. :param string `accelerator`: a string representing the new shortcut string (accelerator). .. method:: SetOldAccelerator(self, accelerator) Sets the previous shortcut string for ``EVT_SHORTCUT_CHANGED`` and ``EVT_SHORTCUT_CHANGING`` events. :param string `accelerator`: a string representing the old shortcut string (accelerator). .. method:: SetShortcut(self, shortcut) Sets the shortcut class used for ``EVT_SHORTCUT_CHANGED`` and ``EVT_SHORTCUT_CHANGING`` events. :param `shortcut`: an instance of :class:`Shortcut`.