У меня есть следующий код для добавления меню «Shoebot», я хотел бы иметь возможность открывать меню с помощью Alt-B, я не могу найти информацию о как будтоКак добавить ускоритель для открытия меню GEdit
ui_str = """
<ui>
<menubar name="MenuBar">
<menu name="ShoebotMenu" action="Shoebot">
<placeholder name="ShoebotOps_1">
<menuitem name="Run in Shoebot" action="ShoebotRun"/>
<separator/>
<menuitem name="Enable Socket Server" action="ShoebotSocket"/>
<menuitem name="Show Variables Window" action="ShoebotVarWindow"/>
<menuitem name="Go Fullscreen" action="ShoebotFullscreen"/>
</placeholder>
</menu>
</menubar>
</ui>
"""
self.action_group = Gtk.ActionGroup("ShoebotPluginActions")
self.action_group.add_actions([
("Shoebot", None, _("Shoebot"), None, _("Shoebot"), None),
("ShoebotRun", None, _("Run in Shoebot"), '<control>R', _("Run in Shoebot"), self.on_run_activate),
])
self.action_group.add_toggle_actions([
("ShoebotSocket", None, _("Enable Socket Server"), '<control><alt>S', _("Enable Socket Server"), self.toggle_socket_server, False),
("ShoebotVarWindow", None, _("Show Variables Window"), '<control><alt>V', _("Show Variables Window"), self.toggle_var_window, False),
("ShoebotFullscreen", None, _("Go Fullscreen"), '<control><alt>F', _("Go Fullscreen"), self.toggle_fullscreen, False),
])
manager.insert_action_group(self.action_group)
self.ui_id = manager.add_ui_from_string(ui_str)