Search code examples
pythonubuntuwxpython

wxPython - "Uknown accel modifier: num/numpad" on Ubuntu


I am trying to hookup some keybindings for a program I am developing on Ubuntu. The keybindings themselves are working, however the wxPython menu cannot seem to map the Numpad keys to the accelerator table so that the hotkey combination appears next to the menu item.

I have tried the few logical variations of the word Numpad that I can think of, including:

menu_item = wx.MenuItem(self._menu, wx.ID_ANY, "&Function 1\tNum+")
menu_item = wx.MenuItem(self._menu, wx.ID_ANY, "&Function 1\tNumpad+")

I have also tried with spaces in between Num/Numpad and the specific key. Note that I have tested on Windows and it seems to recognize them, or it simply doesn't care and adds them anyways.

So does anyone have any idea what the correct string is so that wxPython can recognize the accel modifier?


Solution

  • Just in case anyone comes across this and was wondering, a list of all the different label accelerators can be found at the bottom of the following page:

    http://docs.wxwidgets.org/trunk/classwx_menu_item.html