public void onKeyPressed(KeyEvent event) { 
		switch(event.getKeyCode()) { 
			case KeyEvent.VK_BACK_SPACE:
				if(mFilterString.length() > 0) { 
					mFilterString = mFilterString.substring(0, mFilterString.length() - 1);
				}
				
				mTextArea.setText(mFilterString);
				updateFilter(mFilterString);
				break;
				
			case KeyEvent.VK_ENTER:
				// Submit the current selection
				int selectedIndex = mList.getSelectedIndex();
				if(selectedIndex >= 0) { 
					SimpleAutoCompleteEntry entry = mFilteredEntries.get(selectedIndex);
					mListener.onAutoCompleteCreateReplacement(mController, entry);
				}
				break;
				
			case KeyEvent.VK_UP:
				// Move the selection index upwards
				mList.setSelectedIndex(mList.getSelectedIndex() - 1);
				mList.ensureIndexIsVisible(mList.getSelectedIndex());
				break;
				
			case KeyEvent.VK_DOWN:
				// Move the selection index downwards
				mList.setSelectedIndex(mList.getSelectedIndex() + 1);
				mList.ensureIndexIsVisible(mList.getSelectedIndex());
				break;
				
			default:
				if(event.getKeyChar() != KeyEvent.CHAR_UNDEFINED) { 
					mFilterString = mFilterString + event.getKeyChar();
					mTextArea.setText(mFilterString);
					updateFilter(mFilterString);	
				}
				break;
		}
	}