[core/engine] Register wheel up/down callbacks for desktop switch

Switch desktop to prev/next on wheel up/down.

see #23
This commit is contained in:
Tobi-wan Kenobi 2016-12-10 12:14:12 +01:00
parent 7ea8c5320d
commit 0489ce1b51
2 changed files with 8 additions and 0 deletions

View file

@ -66,6 +66,12 @@ class Engine(object):
self._modules = [] self._modules = []
self.input = inp self.input = inp
self.load_modules(config.modules()) 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() self.input.start()
def load_modules(self, modules): def load_modules(self, modules):

View file

@ -9,6 +9,8 @@ import bumblebee.util
LEFT_MOUSE = 1 LEFT_MOUSE = 1
RIGHT_MOUSE = 3 RIGHT_MOUSE = 3
WHEEL_UP = 4
WHEEL_DOWN = 5
def read_input(inp): def read_input(inp):
"""Read i3bar input and execute callbacks""" """Read i3bar input and execute callbacks"""