void doModifyKeyPressed(KeyEvent event)
    {
        char aChar = event.character;
        if (aChar == '\0' || aChar == '\b' || aChar == '\u007f' || event.stateMask == SWT.CTRL ||
            event.widget == hexText && ((event.stateMask & SWT.MODIFIER_MASK) != 0 ||
                aChar < '0' || aChar > '9' && aChar < 'A' || aChar > 'F' && aChar < 'a' || aChar > 'f')) {
            return;
        }
        boolean origInserting = isInserting;
        if (getCaretPos() == content.length() && !isInserting) {
//            ensureCaretIsVisible();
//            redrawTextAreas(false);
//            return;
            isInserting = true;
        }
        try {
            handleSelectedPreModify();
            try {
                if (isInserting) {
                    if (event.widget == previewText) {
                        content.insert((byte) aChar, getCaretPos());
                    } else if (upANibble == 0) {
                        content.insert((byte) (hexToNibble[aChar - '0'] << 4), getCaretPos());
                    } else {
                        content.overwrite(hexToNibble[aChar - '0'], 4, 4, getCaretPos());
                    }
                } else {
                    if (event.widget == previewText) {
                        content.overwrite((byte) aChar, getCaretPos());
                    } else {
                        content.overwrite(hexToNibble[aChar - '0'], upANibble * 4, 4, getCaretPos());
                    }
                    content.get(ByteBuffer.wrap(tmpRawBuffer, 0, 1), null, getCaretPos());
                    int offset = (int) (getCaretPos() - textAreasStart);
                    hexText.replaceTextRange(offset * 3, 2, GeneralUtils.byteToHex[tmpRawBuffer[0] & 0x0ff]);
                    hexText.setStyleRange(new StyleRange(offset * 3, 2, colorHighlightText, null));
                    previewText.replaceTextRange(
                        offset,
                        1,
                        Character.toString(byteToChar[tmpRawBuffer[0] & 0x0ff]));
                    previewText.setStyleRange(new StyleRange(offset, 1, colorHighlightText, null));
                }
            } catch (IOException e) {
                log.warn(e);
            }
            startPosition = endPosition = incrementPosWithinLimits(getCaretPos(), event.widget == hexText);
            Runnable delayed = () -> {
                ensureCaretIsVisible();
                redrawTextAreas(false);
                if (isInserting) {
                    updateScrollBar();
                    redrawTextAreas(true);
                }
                refreshSelections();
                runnableEnd();
            };
            runnableAdd(delayed);
            notifyListeners(SWT.Modify, null);
            notifyLongSelectionListeners();
        } finally {
            isInserting = origInserting;
        }
    }
While in insert mode, deletes the selection

@return did delete something
plugins/org.jkiss.dbeaver.ui.editors.hex/src/org/jkiss/dbeaver/ui/editors/binary/HexEditControl.java