@Override
  public void setKeyboard(AnyKeyboard newKeyboard, float verticalCorrection) {
    mExtensionKey = null;
    mExtensionVisible = false;

    mUtilityKey = null;
    super.setKeyboard(newKeyboard, verticalCorrection);
    if (newKeyboard != null
        && newKeyboard instanceof GenericKeyboard
        && ((GenericKeyboard) newKeyboard).disableKeyPreviews()) {
      // Phone keyboard never shows popup preview (except language
      // switch).
      setPreviewEnabled(false);
    } else {
      setPreviewEnabled(AnyApplication.getConfig().getShowKeyPreview());
    }
    // TODO: For now! should be a calculated value
    // lots of key : true
    // some keys: false
    setProximityCorrectionEnabled(true);
    // One-seventh of the keyboard width seems like a reasonable threshold
    // mJumpThresholdSquare = newKeyboard.getMinWidth() / 7;
    // mJumpThresholdSquare *= mJumpThresholdSquare;
    // Assuming there are 4 rows, this is the coordinate of the last row
    // mLastRowY = (newKeyboard.getHeight() * 3) / 4;
    // setKeyboardLocal(newKeyboard);

    // looking for the space-bar, so I'll be able to detect swipes starting
    // at it
    mSpaceBarKey = null;
    if (newKeyboard != null) {
      for (Key aKey : newKeyboard.getKeys()) {
        if (aKey.getPrimaryCode() == KeyCodes.SPACE) {
          mSpaceBarKey = aKey;
          break;
        }
      }
    }
  }