summaryrefslogtreecommitdiff
path: root/alot
diff options
context:
space:
mode:
authorSamantha Marshall <me@samdmarshall.com>2017-01-09 14:32:02 -0500
committerSamantha Marshall <me@samdmarshall.com>2017-01-09 17:03:00 -0500
commit83826eedcc14205fb3a14402c704ecbfd64d7466 (patch)
treea71ceb8136777eebb7ee2d3ddd7dc3e5be72dcfb /alot
parent0251ea083dd7cee19e512a2c0ead2c5d8f09e449 (diff)
adding support for mouse scrolling
Diffstat (limited to 'alot')
-rw-r--r--alot/defaults/default.bindings2
-rw-r--r--alot/ui.py4
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
diff --git a/alot/ui.py b/alot/ui.py
index 62592303..fa8e3ac4 100644
--- a/alot/ui.py
+++ b/alot/ui.py
@@ -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,