changeset 72:9c96d374aaae

We now properly pass-through hotkey keypresses.
author Atul Varma <varmaa@toolness.com>
date Sun, 18 May 2008 23:47:15 -0700
parents 65a960c019bb
children 5c35e18a9d1a
files web-zui.js
diffstat 1 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/web-zui.js	Sun May 18 23:38:04 2008 -0700
+++ b/web-zui.js	Sun May 18 23:47:15 2008 -0700
@@ -64,15 +64,22 @@
     // listeners may think that they can intervene and capture
     // keystrokes before they get to us in the future.
 
+    _isHotKey: function(event) {
+      return (event.altKey || event.ctrlKey || event.metaKey);
+    },
+
     _windowKeyup: function(event) {
-      return false;
+      return self._isHotKey(event);
     },
 
     _windowKeydown: function(event) {
-      return false;
+      return self._isHotKey(event);
     },
 
     _windowKeypress: function(event) {
+      if (self._isHotKey(event))
+        return true;
+
       if ($("#current-input").length == 0) {
         // We're not waiting for a line of input, but we may
         // be waiting for a character of input.
@@ -142,6 +149,7 @@
             '<span id="cursor">_</span>'
         );
       }
+      return false;
     },
 
     _windowResize: function() {