private void deletePreviousCharacter(){
  if (insertionPoint == 2) {
    if (buffer.length() == 2) {
      cancelComposition();
    }
 else {
      beep();
    }
  }
 else   if (insertionPoint == 8) {
    if (buffer.length() == 8) {
      if (format == SURROGATE_PAIR) {
        buffer.deleteCharAt(--insertionPoint);
      }
      buffer.deleteCharAt(--insertionPoint);
      sendComposedText();
    }
 else {
      beep();
    }
  }
 else {
    buffer.deleteCharAt(--insertionPoint);
    if (buffer.length() == 0) {
      sendCommittedText();
    }
 else {
      sendComposedText();
    }
  }
}

private void deletePreviousCharacter ( ) { if ( insertionPoint == 2 ) { if ( buffer . length ( ) == 2 ) { cancelComposition ( ) ; } else { beep ( ) ; } } else if ( insertionPoint == 8 ) { if ( buffer . length ( ) == 8 ) { if ( format == SURROGATE_PAIR ) { buffer . deleteCharAt ( -- insertionPoint ) ; } buffer . deleteCharAt ( -- insertionPoint ) ; sendComposedText ( ) ; } else { beep ( ) ; } } else { buffer . deleteCharAt ( -- insertionPoint ) ; if ( buffer . length ( ) == 0 ) { sendCommittedText ( ) ; } else { sendComposedText ( ) ; } } }
delete the character preceding the insertion point in the composed text . if the insertion point is not at the end of the composed text and the preceding text is " \ \ u " or " \ \ u " , ring the bell .
