diff options
author | Dylan Baker <baker.dylan.c@gmail.com> | 2017-01-09 14:57:52 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-09 14:57:52 -0800 |
commit | 658f83d7e5c78894bb427e088af51b092c1fb256 (patch) | |
tree | 07c6804942d8a7c28f9b785603de38fe288999f0 | |
parent | f395efb3a01495795680ca90904ad87edb56c2f5 (diff) | |
parent | 83826eedcc14205fb3a14402c704ecbfd64d7466 (diff) |
Merge pull request #952 from samdmarshall/master
adding support for mouse scrolling
-rw-r--r-- | alot/defaults/default.bindings | 2 | ||||
-rw-r--r-- | alot/ui.py | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/alot/defaults/default.bindings b/alot/defaults/default.bindings index 8629f01a..a6afee2f 100644 --- a/alot/defaults/default.bindings +++ b/alot/defaults/default.bindings @@ -2,6 +2,8 @@ up = move up down = move down page up = move page up page down = move page down +mouse press 4 = move up +mouse press 5 = move down j = move down k = move up 'g g' = move first @@ -96,7 +96,7 @@ class UI(object): # set up main loop self.mainloop = urwid.MainLoop(self.root_widget, - handle_mouse=False, + handle_mouse=True, event_loop=urwid.TwistedEventLoop(), unhandled_input=self._unhandeled_input, input_filter=self._input_filter) @@ -157,6 +157,8 @@ class UI(object): return [cmdline[5:]] key = keys[0] + if key and key[0].startswith('mouse'): + key = key[0] + ' %i' % key[1] self.input_queue.append(key) keyseq = ' '.join(self.input_queue) candidates = settings.get_mapped_input_keysequences(self.mode, |