@ Override protected void keyTyped ( char keyChar , int keyCode ) { try { boolean ret = false ; for ( IKeyListener listener : keyListeners ) ret |= listener . onKeyTyped ( keyChar , keyCode ) ; if ( ret ) return ; if ( focusedComponent != null && ! keyListeners . contains ( focusedComponent ) && focusedComponent . onKeyTyped ( keyChar , keyCode ) ) return ; if ( hoveredComponent != null && ! keyListeners . contains ( hoveredComponent ) && hoveredComponent . onKeyTyped ( keyChar , keyCode ) ) return ; if ( isGuiCloseKey ( keyCode ) && mc . currentScreen == this ) close ( ) ; if ( ! MalisisCore . isObfEnv && isCtrlKeyDown ( ) && ( current ( ) != null || isOverlay ) ) { if ( keyCode == Keyboard . KEY_R ) { clearScreen ( ) ; setResolution ( ) ; setHoveredComponent ( null , true ) ; setFocusedComponent ( null , true ) ; constructed = false ; doConstruct ( ) ; } if ( keyCode == Keyboard . KEY_D ) { debug = ! debug ; debugComponent . setEnabled ( debug ) ; } if ( keyCode == Keyboard . KEY_P ) { Position . CACHED = ! Position . CACHED ; } if ( keyCode == Keyboard . KEY_S ) { Size . CACHED = ! Size . CACHED ; } } } catch ( Exception e ) { MalisisCore . message ( "A problem occured while handling key typed for " + e . getClass ( ) . getSimpleName ( ) + ": " + e . getMessage ( ) ) ; e . printStackTrace ( new PrintStream ( new FileOutputStream ( FileDescriptor . out ) ) ) ; } }
Called when a key is pressed on the keyboard .