diff options
author | Samantha Marshall <me@samdmarshall.com> | 2017-01-09 14:32:02 -0500 |
---|---|---|
committer | Samantha Marshall <me@samdmarshall.com> | 2017-01-09 17:03:00 -0500 |
commit | 83826eedcc14205fb3a14402c704ecbfd64d7466 (patch) | |
tree | a71ceb8136777eebb7ee2d3ddd7dc3e5be72dcfb /alot | |
parent | 0251ea083dd7cee19e512a2c0ead2c5d8f09e449 (diff) |
adding support for mouse scrolling
Diffstat (limited to 'alot')
-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, |