changeset 1003:b9aec3be2b8c

hw sliders send events in a way that piles up and we get big delays. this is a simple throttle that stops the pileup but interactivity is still bumpy Ignore-this: a755c0611adee694bffc6fb08d3f767b
author drewp@bigasterisk.com
date Mon, 17 Jun 2013 00:25:17 +0000
parents 9c9b68302bf7
children 18885a10b119
files bin/keyboardcomposer
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/bin/keyboardcomposer	Sun Jun 16 23:36:45 2013 +0000
+++ b/bin/keyboardcomposer	Mon Jun 17 00:25:17 2013 +0000
@@ -375,7 +375,14 @@
             subbox = self.slider_table[(self.current_row, col)]
         except KeyError:
             return # no slider assigned at that column
-        subbox.slider_var.set(value)
+
+        if hasattr(self, 'pendingHwSet'):
+            import twisted.internet.error
+            try:
+                self.pendingHwSet.cancel()
+            except twisted.internet.error.AlreadyCalled:
+                pass
+        self.pendingHwSet = reactor.callLater(.01, subbox.slider_var.set, value)
 
     def send_to_hw(self, sub, hwCol, boxRow):
         if isinstance(self.sliders, DummySliders):