topical media & game development

talk show tell print

mobile-query-three-plugins-keyboard-tquery.keyboard.js / js



  
tquery.js plugin to handle keyboard

  
  (function(){
          var instance        = null;
          tQuery.registerStatic('keyboard', function(domElement){
                  // default to renderer domElement
                  if( !instance ){
                          if( !domElement ){
                                  domElement        = tQuery.world.tRenderer().domElement;
                                  // make it focusable. needed to get keyboard event
                                  domElement.setAttribute("tabIndex", "0");
                                  domElement.focus();        
                          }
                          instance        = new THREEx.KeyboardState(domElement);
                  }
                  return instance;
          });                        
  })();
  


(C) Æliens 04/09/2009

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.