diff --git a/bumblebee-status b/bumblebee-status index dcaa8bd..9e4ea82 100755 --- a/bumblebee-status +++ b/bumblebee-status @@ -102,6 +102,7 @@ def main(): for module in config.modules(): modules.append(core.module.load(module, config, theme)) + modules[-1].register_callbacks() if config.reverse(): modules.reverse() diff --git a/bumblebee_status/core/module.py b/bumblebee_status/core/module.py index d8faa1c..e01d652 100644 --- a/bumblebee_status/core/module.py +++ b/bumblebee_status/core/module.py @@ -201,6 +201,18 @@ class Module(core.input.Object): return "warning" return None + def register_callbacks(self): + actions = [ + { "name": "left-click", "id": core.input.LEFT_MOUSE }, + { "name": "right-click", "id": core.input.RIGHT_MOUSE }, + { "name": "middle-click", "id": core.input.MIDDLE_MOUSE }, + { "name": "wheel-up", "id": core.input.WHEEL_UP }, + { "name": "wheel-down", "id": core.input.WHEEL_DOWN }, + ] + for action in actions: + if self.parameter(action["name"]): + core.input.register(self, action["id"], self.parameter(action["name"])) + class Error(Module): """Represents an "error" module