events


          function onEvent(e,t) {
              if(e.type == 'keydown') {
              str = 'press: ' + e.keyCode;
              //print(str);
              string = new MFString(str);
              e.returnValue = false; // no further processing
              } else  if(e.type == 'keyup') {
              str = 'release: ' + e.keyCode;
              //print(str);
              string = new MFString(str);
              e.returnValue = false; // no further processing
              } 
          }
      "
  }
  
  }
  
  Viewpoint { position 0 0 10 }
  DEF keyboard keyboard { }
  DEF monitor monitor { string [ "hit a key" "(click to focus)" ] }
  
  ROUTE keyboard.string TO monitor.string