diff --git a/bumblebee/module.py b/bumblebee/module.py index efbf498..aac2c3a 100644 --- a/bumblebee/module.py +++ b/bumblebee/module.py @@ -39,6 +39,21 @@ class Module(object): name = "{}.".format(alias if alias else self.__module__.split(".")[-1]) self._config = bumblebee.config.ModuleConfig(config, name) + buttons = [ + { "name": "left-click", "id": 1 }, + { "name": "middle-click", "id": 2 }, + { "name": "right-click", "id": 3 }, + { "name": "wheel-up", "id": 4 }, + { "name": "wheel-down", "id": 5 }, + ] + for button in buttons: + if self._config.parameter(button["name"], None): + output.add_callback( + module=self.instance(), + button=button["id"], + cmd=self._config.parameter(button["name"]) + ) + def critical(self, widget): return False diff --git a/bumblebee/output.py b/bumblebee/output.py index 605da67..43d7688 100644 --- a/bumblebee/output.py +++ b/bumblebee/output.py @@ -63,6 +63,8 @@ class Output(object): if module: module = module.replace("bumblebee.modules.", "") + if self._callbacks.get((button, module)): return + self._callbacks[( button, module,