if (inKey == ' ') virtualKey = 49;
public void setAccelerator (int accelerator) {	checkWidget ();	short [] outIndex = new short [1];	if (OS.GetIndMenuItemWithCommandID (parent.handle, id, 1, null, outIndex) != OS.kNoErr) {		return;	}	boolean update = (this.accelerator == 0 && accelerator != 0) || (this.accelerator != 0 && accelerator == 0);	this.accelerator = accelerator;	boolean inSetVirtualKey = false;	int inModifiers = OS.kMenuNoModifiers, inGlyph = OS.kMenuNullGlyph, inKey = 0;	if (accelerator != 0) {		inKey = accelerator & ~(SWT.SHIFT | SWT.CONTROL | SWT.ALT | SWT.COMMAND);		if (MacUtil.KEEP_MAC_SHORTCUTS) {			if ((accelerator & SWT.COMMAND) != 0)				if (inKey == 'H' || inKey == 'Q') return;		}		inGlyph = keyGlyph (inKey);		int virtualKey = Display.untranslateKey (inKey);		if (virtualKey != 0) {			inSetVirtualKey = true;			inKey = virtualKey;		} else {			inKey = Character.toUpperCase ((char)inKey);		}		inModifiers = (byte) OS.kMenuNoCommandModifier;		if ((accelerator & SWT.SHIFT) != 0) inModifiers |= OS.kMenuShiftModifier;		if ((accelerator & SWT.CONTROL) != 0) inModifiers |= OS.kMenuControlModifier;		if ((accelerator & SWT.COMMAND) != 0) inModifiers &= ~OS.kMenuNoCommandModifier;		if ((accelerator & SWT.ALT) != 0) inModifiers |= OS.kMenuOptionModifier;	}	OS.SetMenuItemModifiers (parent.handle, outIndex [0], (byte)inModifiers);	OS.SetMenuItemCommandKey (parent.handle, outIndex [0], inSetVirtualKey, (char)inKey);	OS.SetMenuItemKeyGlyph (parent.handle, outIndex [0], (short)inGlyph);	if (update) updateText ();}