summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorJim Garrison <jim@garrison.cc>2013-03-31 20:10:58 -0700
committerJim Garrison <jim@garrison.cc>2013-03-31 20:10:58 -0700
commitbab5717af2f444eb084ed453588dbfb0f500b7c8 (patch)
tree8a50c90efd33ff9e20f1c4094e086ea2f36febe6 /examples
parent3672372a924e2c08c5de0f16cfa709eacfe0bde9 (diff)
downloadurwid-bab5717af2f444eb084ed453588dbfb0f500b7c8.tar.gz
allow Screen.set_mouse_tracking(False) to disable mouse tracking
Diffstat (limited to 'examples')
-rw-r--r--examples/twisted_serve_ssh.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/examples/twisted_serve_ssh.py b/examples/twisted_serve_ssh.py
index 9562bc6..64dcdc7 100644
--- a/examples/twisted_serve_ssh.py
+++ b/examples/twisted_serve_ssh.py
@@ -221,14 +221,17 @@ class TwistedScreen(urwid.BaseScreen):
self.terminal.cursorPosition(*cursor)
# XXX from base screen
- def set_mouse_tracking(self):
+ def set_mouse_tracking(self, enable=True):
"""
- Enable mouse tracking.
+ Enable (or disable) mouse tracking.
After calling this function get_input will include mouse
click events along with keystrokes.
"""
- self.write(urwid.escape.MOUSE_TRACKING_ON)
+ if enable:
+ self.write(urwid.escape.MOUSE_TRACKING_ON)
+ else:
+ self.write(urwid.escape.MOUSE_TRACKING_OFF)
# twisted handles polling, so we don't need the loop to do it, we just
# push what we get to the loop from dataReceived.