@Override
        public void keyPressed(KeyEvent e)
        {
            switch (e.keyCode) {
                case SWT.ARROW_UP:
                case SWT.ARROW_DOWN:
                case SWT.ARROW_LEFT:
                case SWT.ARROW_RIGHT:
                case SWT.END:
                case SWT.HOME:
                case SWT.PAGE_UP:
                case SWT.PAGE_DOWN:
                    //boolean selection = startPosition != endPosition;
                    boolean ctrlKey = (e.stateMask & SWT.CONTROL) != 0;
                    if ((e.stateMask & SWT.SHIFT) != 0) {  // shift mod2
                        long newPos = doNavigateKeyPressed(ctrlKey, e.keyCode, getCaretPos(), false);
                        shiftStartAndEnd(newPos);
                    } else {  // if no modifier or control or alt
                        endPosition = startPosition = doNavigateKeyPressed(
                            ctrlKey,
                            e.keyCode,
                            getCaretPos(),
                            e.widget == hexText && !isInserting);
                        caretStickToStart = false;
                    }
                    ensureCaretIsVisible();
                    Runnable delayed = () -> {
                        redrawTextAreas(false);
                        runnableEnd();
                    };
                    runnableAdd(delayed);
                    notifyLongSelectionListeners();
//                    if (selection != (startPosition != endPosition))
//                        notifyListeners(SWT.Modify, null);
                    e.doit = false;
                    break;
                case SWT.INSERT:
                    if ((e.stateMask & SWT.MODIFIER_MASK) == 0) {
                        redrawCaret(true);
                    } else if (!readOnly && e.stateMask == SWT.SHIFT) {
                        paste();
                    } else if (e.stateMask == SWT.CONTROL) {
                        copy();
                    }
                    break;
                case 'a':
                    if (e.stateMask == SWT.CONTROL)  // control mod1
                        selectAll();
                    break;
                case 'c':
                    if (e.stateMask == SWT.CONTROL)  // control mod1
                        copy();
                    break;
                case 'v':
                    if (!readOnly && e.stateMask == SWT.CONTROL)  // control mod1
                        paste();
                    break;
                case 'x':
                    if (!readOnly && e.stateMask == SWT.CONTROL)  // control mod1
                        cut();
                    break;
                case 'y':
                    if (!readOnly && e.stateMask == SWT.CONTROL)  // control mod1
                        redo();
                    break;
                case 'z':
                    if (!readOnly && e.stateMask == SWT.CONTROL)  // control mod1
                        undo();
                    break;
                default:
                    break;
            }
        }
Converts a hex String to byte[]. Will convert full bytes only, odd number of hex characters will
have a leading '0' added. Big endian.

@param hexString an hex string (ie. "0fdA1").
@return the byte[] value of the hex string
plugins/org.jkiss.dbeaver.ui.editors.hex/src/org/jkiss/dbeaver/ui/editors/binary/HexEditControl.java