GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Table of Contents
  • wx.AcceleratorEntry
  • Show Source
  • index
  • modules
  • next
  • previous
  • Home
  • Gallery
  • wx

This view

  • Original page
  • New address

GeezerVison is showing docs.wxpython.org — wx.AcceleratorEntry — wxPython 4.3.2 Docs

phoenix_title wx.AcceleratorEntry¶

An object used by an application wishing to create an accelerator table (see wx.AcceleratorTable).

See also

wx.AcceleratorTable, wx.Window.SetAcceleratorTable


class_hierarchy Class Hierarchy¶

Inheritance diagram for class AcceleratorEntry:

Inheritance diagram of AcceleratorEntry


method_summary Methods Summary¶

__init__

Constructor.

FromString

Parses the given string and sets the accelerator accordingly.

GetCommand

Returns the command identifier for the accelerator table entry.

GetFlags

Returns the flags for the accelerator table entry.

GetKeyCode

Returns the keycode for the accelerator table entry.

GetMenuItem

Returns the menu item associated with this accelerator entry.

IsOk

Returns True if this object is correctly initialized.

MatchesEvent

Returns True if the given key event corresponds to this accelerator.

Set

Sets the accelerator entry parameters.

ToRawString

Returns a textual representation of this accelerator which is appropriate for saving in configuration files.

ToString

Returns a textual representation of this accelerator.

__ne__

__eq__


property_summary Properties Summary¶

Command

See GetCommand

Flags

See GetFlags

KeyCode

See GetKeyCode

MenuItem

See GetMenuItem


api Class API¶

class wx.AcceleratorEntry(object)¶

Possible constructors:

AcceleratorEntry(flags=0, keyCode=0, cmd=0, item=None) -> None

AcceleratorEntry(entry) -> None

An object used by an application wishing to create an accelerator table (see AcceleratorTable).


Methods¶

__init__(self, *args, **kw)¶

overload Overloaded Implementations:



__init__ (self, flags=0, keyCode=0, cmd=0, item=None)

Constructor.

Parameters:
  • flags (int) – A combination of the wx.AcceleratorEntryFlags values, which indicates which modifier keys are held down.

  • keyCode (int) – The keycode to be detected. See wx.KeyCode for a full list of keycodes.

  • cmd (int) – The menu or control command identifier (ID).

  • item (wx.MenuItem) – The menu item associated with this accelerator.

Return type:

None



__init__ (self, entry)

Copy constructor.

Parameters:

entry (wx.AcceleratorEntry)

Return type:

None





FromString(self, str)¶

Parses the given string and sets the accelerator accordingly.

Parameters:

str (string) – This string may be either in the same format as returned by wx.ToString , i.e. contain the accelerator itself only, or have the format of a full menu item text with i.e. Label TAB Accelerator . In the latter case, the part of the string before the TAB is ignored. Notice that the latter format is only supported for the compatibility with the previous wxWidgets versions and the new code should pass only the accelerator string itself to this function.

Return type:

bool

Returns:

True if the given string correctly initialized this object (i.e. if IsOk returns True after this call)



GetCommand(self)¶

Returns the command identifier for the accelerator table entry.

Return type:

int



GetFlags(self)¶

Returns the flags for the accelerator table entry.

Return type:

int



GetKeyCode(self)¶

Returns the keycode for the accelerator table entry.

Return type:

int



GetMenuItem(self)¶

Returns the menu item associated with this accelerator entry.

Return type:

wx.MenuItem



IsOk(self)¶

Returns True if this object is correctly initialized.

Return type:

bool



MatchesEvent(self, event)¶

Returns True if the given key event corresponds to this accelerator.

All the modifiers must match exactly and the key codes are compared case-insensitively for the letters, i.e. an accelerator created from the string "Ctrl-a" matches the event for Ctrl-A .

Note that this function should be used with the key press events, i.e. wxEVT_KEY_DOWN , wxEVT_CHAR_HOOK or wxEVT_ACCELERATOR_KEY , but not with wxEVT_CHAR whose key codes are different.

Parameters:

event (wx.KeyEvent)

Return type:

bool

Added in version 4.3/wxWidgets-3.3.4.



Set(self, flags, keyCode, cmd, item=None)¶

Sets the accelerator entry parameters.

Parameters:
  • flags (int) – A combination of the wx.AcceleratorEntryFlags values, which indicates which modifier keys are held down.

  • keyCode (int) – The keycode to be detected. See wx.KeyCode for a full list of keycodes.

  • cmd (int) – The menu or control command identifier (ID).

  • item (wx.MenuItem) – The menu item associated with this accelerator.

Return type:

None



ToRawString(self)¶

Returns a textual representation of this accelerator which is appropriate for saving in configuration files.

Unlike the string returned by wx.ToString , this one is never translated so, while it’s not suitable for showing to the user, it can be used to uniquely identify the accelerator independently of the user language.

The returned string can still be parsed by wx.FromString .

Return type:

str

Added in version 2.9.4.



ToString(self)¶

Returns a textual representation of this accelerator.

The returned string is of the form [Alt+][Ctrl+][RawCtrl+][Shift+]Key where the modifier keys are present only if the corresponding flag is set.

Return type:

str



__ne__(self, entry)¶
Parameters:

entry (wx.AcceleratorEntry)

Return type:

bool



__eq__(self, entry)¶
Parameters:

entry (wx.AcceleratorEntry)

Return type:

bool


Properties¶

Command¶

See GetCommand



Flags¶

See GetFlags



KeyCode¶

See GetKeyCode



MenuItem¶

See GetMenuItem

© Copyright 2012-2026, The wxPython Team. Created using Sphinx 9.1.0 and the python-docs-theme.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.