code: function(e) {
          // only prevent something if DOM event targets Crafty's stage
          // prevent bubbling up for all events except key events backspace and F1-F12.
          // prevent default actions for all events except key events backspace and F1-F12 and except actions on INPUT and TEXTAREA.
          // Among others this prevent the arrow keys from scrolling the parent page of an iframe hosting the game
          if (
              Crafty.selected &&
              !(e.key === 8 || (e.key >= 112 && e.key <= 135))
          ) {
              if (e.stopPropagation) e.stopPropagation();
              else e.cancelBubble = true;
  
              // Don't prevent default actions if target node is input or textarea.
              if (
                  !e.target ||
                  (e.target.nodeName !== "INPUT" &&
                      e.target.nodeName !== "TEXTAREA")
              ) {
                  if (e.preventDefault) {
                      e.preventDefault();
                  } else {
                      e.returnValue = false;
                  }
                  return false;
              }
              return true;
          }
      }
docs: prevents interaction with page (e.g. scrolling of page), if DOM events target Crafty's stage automatically called for all incoming DOM events