title: Ace-editor focus / blur methods apparently not works integrated with termlib.js
body: <p>Im developing a project were i need ace-editor integrated with terminal emulator; all problems
  are exemplified <a href="http://jsfiddle.net/34EaM/12/" rel="nofollow">here</a></p>
  
  <p>The problems lacks when human interaction fails: a user hoven on terminal and editor until he exit page. I want to set .focus() on "hoved" element and .blur() to "not hoved" element. To terminal, works ok, bot ace-editor fails on focusing. I can't be able to push some chars on editor.</p>
  
  <p>Apparently jquery not works here:</p>
  
  <pre><code>$('#terminal').hover(function(){
    TermGlobals.setFocus(true);
  }, function(){
    TermGlobals.setFocus(false);
  })
  
  $('#coffee_editor &gt; textarea').hover(function(){
    window.editor.focus();
  }, function(){
    window.editor.blur();
  })
  </code></pre>
  
  <p>Someone have an clear idea why it isnt work properly?</p>
  
  <p>Thanks for anything</p>
  
  <h1>RESOLVED!</h1>
  
  <p>I remember <a href="http://www.masswerk.at/termlib/readme.txt" rel="nofollow">RTFM</a></p>
  
  <pre><code>7.2  TermGlobals.keylock (Global Locking Flag)
  
  The global flag `TermGlobals.keylock' allows temporary keyboard locking without any
  other change of state. Use this to free the keyboard for any other resources.
  (added in v.1.03)
  </code></pre>
  
  <p>So I added the following in <a href="http://jsfiddle.net/34EaM/13/" rel="nofollow">jsfiddle</a>:</p>
  
  <pre><code>$('#terminal').hover(function () {
      TermGlobals.keylock = false;
      term.focus();
  }, function () {
      TermGlobals.setFocus(false);
  });
  
  $('#coffee_editor').hover(function () {
      TermGlobals.keylock = true;
      window.editor.focus();
  }, function () {
      window.editor.blur();
  });
  </code></pre>
  
  <p>What's weird is that <a href="http://jsfiddle.net/34EaM/13/" rel="nofollow">jsfiddle</a> isnt working properly, but in <a href="https://github.com/jahpd/yaknowboutblogmusic/blob/master/app/helpers/terminal/builder.rb" rel="nofollow">my project</a> works very well. Im running a Rails server, while jsfiddle runs inside <code>&lt;iframe&gt;</code>; why this difference in work?</p>