(function() {

// Determine which window is active.
window.SC_isActive = false;
var handleFocusEvent = function(e) {
    window.SC_isActive = true;
};
var handleBlurEvent = function(e) {
    window.SC_isActive = false;
};
window.addEventListener("focus", handleFocusEvent)
window.addEventListener("blur", handleBlurEvent)

// Handle keyboard events.
var handleKeyboardEvent = function(e) {
    var inputIsActive = false;
    var activeElement = document.activeElement;
    if (activeElement && (activeElement.tagName === "INPUT" || activeElement.tagName === "TEXTAREA")) {
        inputIsActive = true;
    }
    
    if (e.keyCode === 191 && !inputIsActive) {        // '/'
        top.chatpane.focus();
        top.chatpane.chatform.graf.focus();
        top.chatpane.chatform.graf.value = "/";
    }
    else if (e.keyCode === 190 && !inputIsActive) {   // '.'
        top.chatpane.focus();
        top.chatpane.chatform.graf.focus();
    }
    else if (e.keyCode === 68 && e.ctrlKey) {         // 'd'
        top.mainpane.focus();
    }
};

window.addEventListener("keydown", handleKeyboardEvent)

})();

@@ -607,16 +607,46 @@
  %7D%0A    %0A
+    var handledEvent = false;%0A
     if (
@@ -820,16 +820,45 @@
  = %22/%22;%0A
+        handledEvent = true;%0A
     %7D%0A  
@@ -986,24 +986,53 @@
 af.focus();%0A
+        handledEvent = true;%0A
     %7D%0A    el
@@ -1083,16 +1083,17 @@
     // '
+%5E
 d'%0A     
@@ -1113,24 +1113,145 @@
 ne.focus();%0A
+        handledEvent = true;%0A    %7D%0A    %0A    if (handledEvent) %7B%0A        e.preventDefault();%0A        e.stopPropagation();%0A
     %7D%0A%7D;%0A%0Awi

Fix an issue with chat field focus commands.