fscommand('trapallkeys', true ); txt = createTextField('txt', 1, 10, 10, 100, 100 ); function onKeyDown(){ txt.text = Key.getCode(); } Key.addListener(this);