summaryrefslogtreecommitdiff
path: root/src/plugin.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2011-11-13 19:43:31 +0100
committermathieui <mathieui@mathieui.net>2011-11-13 19:43:31 +0100
commit39fcd9a4f6ace2e00f133bfaa15b1eaf0a0dce9a (patch)
tree1f776be9ad76adce37439ba22a7eeaa60355b370 /src/plugin.py
parentba7ee1d76c059a4d921a8f62e680dcf8d16adfa6 (diff)
downloadpoezio-39fcd9a4f6ace2e00f133bfaa15b1eaf0a0dce9a.tar.gz
poezio-39fcd9a4f6ace2e00f133bfaa15b1eaf0a0dce9a.tar.bz2
poezio-39fcd9a4f6ace2e00f133bfaa15b1eaf0a0dce9a.tar.xz
poezio-39fcd9a4f6ace2e00f133bfaa15b1eaf0a0dce9a.zip
Allow a plugin to add a keybinding
Diffstat (limited to 'src/plugin.py')
-rw-r--r--src/plugin.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/plugin.py b/src/plugin.py
index 92adbc4b..ddc3253e 100644
--- a/src/plugin.py
+++ b/src/plugin.py
@@ -96,6 +96,18 @@ class BasePlugin(object, metaclass=SafetyMetaclass):
"""
return self.plugin_manager.del_command(self.__module__, name)
+ def add_key(self, key, handler):
+ """
+ Add a global keybind
+ """
+ return self.plugin_manager.add_key(self.__module__, key, handler)
+
+ def del_key(self, key):
+ """
+ Remove a global keybind
+ """
+ return self.plugin_manager.del_key(self.__module__, key)
+
def add_tab_command(self, tab_type, name, handler, help, completion=None):
"""
Add a command only for a type of tab.