} finally { this.isScreenChangeDirtyFlag = false;
	public synchronized void keyPressed(int keyCode) {		try {			//#debug			System.out.println("keyPressed: [" + keyCode + "].");			int gameAction = -1;			//#if polish.blackberry				this.keyPressedProcessed = true;			//#endif			//#if tmp.menuFullScreen				/*				//#ifdef polish.key.ReturnKey:defined					//#if  polish.key.ReturnKey == polish.key.ClearKey						//#define tmp.checkReturnKeyLater					//#else						//#= if ( (keyCode == ${polish.key.ReturnKey}) && (this.backCommand != null) ) {								callCommandListener( this.backCommand );								repaint();								//# return;						//# }					//#endif				//#endif				 * 				 */				//#ifdef tmp.useExternalMenuBar					if (this.menuBar.handleKeyPressed(keyCode, 0)) {						repaint();						return;					}					if (this.menuBar.isSoftKeyPressed) {						//#if polish.blackberry							this.keyPressedProcessed = false;						//#endif						return;					}				//#else					if (keyCode == LEFT_SOFT_KEY) {						if ( this.menuSingleLeftCommand != null) {							callCommandListener( this.menuSingleLeftCommand );							return;						} else {							if (!this.menuOpened 									&& this.menuContainer != null 									&&  this.menuContainer.size() != 0 ) 							{								openMenu( true );								repaint();								return;							} else {								gameAction = Canvas.FIRE;							}						}					} else if (keyCode == RIGHT_SOFT_KEY) {						if (!this.menuOpened && this.menuSingleRightCommand != null) {							callCommandListener( this.menuSingleRightCommand );							return;						}					}					boolean doReturn = false;					if (keyCode != LEFT_SOFT_KEY && keyCode != RIGHT_SOFT_KEY ) {						try {							gameAction = getGameAction( keyCode );						} catch (Exception e) { // can happen on certain shitty devices							//#debug warn							System.out.println("Unable to get game action for key code " + keyCode + ": " + e );						}					} else {						//#if polish.blackberry							this.keyPressedProcessed = false;						//#endif						doReturn = true;					}					if (this.menuOpened) {						if (keyCode == RIGHT_SOFT_KEY ) {							int selectedIndex = this.menuContainer.getFocusedIndex();							if (!this.menuContainer.handleKeyPressed(0, LEFT)									|| selectedIndex != this.menuContainer.getFocusedIndex() ) 							{								openMenu( false );							}//						} else if ( gameAction == Canvas.FIRE ) {//							int focusedIndex = this.menuContainer.getFocusedIndex();//							Command cmd = (Command) this.menuCommands.get( focusedIndex );//							this.menuOpened = false;//							callCommandListener( cmd );						} else { 							this.menuContainer.handleKeyPressed(keyCode, gameAction);						}						repaint();						return;					}					if (doReturn) {						return;					}				//#endif			//#endif			if (gameAction == -1) {				try {					gameAction = getGameAction(keyCode);				} catch (Exception e) { // can happen when code is a  LEFT/RIGHT softkey on SE devices, for example					//#debug warn					System.out.println("Unable to get game action for key code " + keyCode + ": " + e );				}			}			//#if (polish.Screen.FireTriggersOkCommand == true) && tmp.menuFullScreen				if (gameAction == FIRE && keyCode != Canvas.KEY_NUM5 && this.okCommand != null) {					callCommandListener(this.okCommand);					return;				}			//#endif			boolean processed = handleKeyPressed(keyCode, gameAction);			//#ifdef polish.debug.debug				if (!processed) {					//#debug					System.out.println("unable to handle key [" + keyCode + "].");				}			//#endif			//#if tmp.menuFullScreen && polish.key.ReturnKey:defined			// # if  tmp.checkReturnKeyLater				if (!processed) {					//#= if ( (keyCode == ${polish.key.ReturnKey}) && (this.backCommand != null) ) {							callCommandListener( this.backCommand );							processed = true;					//# }				}			//#endif			//#if polish.blackberry				this.keyPressedProcessed = processed;			//#endif			//#if tmp.menuFullScreen				if (!processed && gameAction == FIRE && keyCode != Canvas.KEY_NUM5 && this.okCommand != null) {					callCommandListener(this.okCommand);				}			//#endif			if (processed) {				if (this.screenStateListener != null) {					this.screenStateListener.screenStateChanged(this);				}				repaint();			}		} catch (Exception e) {			//#if !polish.debug.error 				e.printStackTrace();			//#endif			//#debug error			System.out.println("keyPressed() threw an exception" + e );		}	}