From 0489ce1b518583960111d4886e071604fcf09385 Mon Sep 17 00:00:00 2001 From: Tobi-wan Kenobi Date: Sat, 10 Dec 2016 12:14:12 +0100 Subject: [PATCH] [core/engine] Register wheel up/down callbacks for desktop switch Switch desktop to prev/next on wheel up/down. see #23 --- bumblebee/engine.py | 6 ++++++ bumblebee/input.py | 2 ++ 2 files changed, 8 insertions(+) diff --git a/bumblebee/engine.py b/bumblebee/engine.py index f0b6e03..5c8d848 100644 --- a/bumblebee/engine.py +++ b/bumblebee/engine.py @@ -66,6 +66,12 @@ class Engine(object): self._modules = [] self.input = inp self.load_modules(config.modules()) + + self.input.register_callback(None, bumblebee.input.WHEEL_UP, + "i3-msg workspace prev_on_output") + self.input.register_callback(None, bumblebee.input.WHEEL_DOWN, + "i3-msg workspace next_on_output") + self.input.start() def load_modules(self, modules): diff --git a/bumblebee/input.py b/bumblebee/input.py index 75eaec6..76b9bf6 100644 --- a/bumblebee/input.py +++ b/bumblebee/input.py @@ -9,6 +9,8 @@ import bumblebee.util LEFT_MOUSE = 1 RIGHT_MOUSE = 3 +WHEEL_UP = 4 +WHEEL_DOWN = 5 def read_input(inp): """Read i3bar input and execute callbacks"""