public void deleteLast(){
  final int codesSize=mCodes.size();
  if (codesSize > 0) {
    mCodes.remove(codesSize - 1);
    final int lastPos=mTypedWord.length() - 1;
    char last=mTypedWord.charAt(lastPos);
    mTypedWord.deleteCharAt(lastPos);
    if (Character.isUpperCase(last))     mCapsCount--;
  }
}

public void deleteLast ( ) { final int codesSize = mCodes . size ( ) ; if ( codesSize > 0 ) { mCodes . remove ( codesSize - 1 ) ; final int lastPos = mTypedWord . length ( ) - 1 ; char last = mTypedWord . charAt ( lastPos ) ; mTypedWord . deleteCharAt ( lastPos ) ; if ( Character . isUpperCase ( last ) ) mCapsCount -- ; } }
delete the last keystroke as a result of hitting backspace .
