/** * <p> * Converts the given event into an SWT accelerator value -- considering the * modified character with the shift modifier. This is the third accelerator * value that should be checked when processing incoming key events. * </p> * <p> * For example, on a standard US keyboard, "Ctrl+Shift+5" would be viewed as * "Ctrl+Shift+%". * </p> * * @param event * The event to be converted; must not be <code>null</code>. * @return The combination of the state mask and the unmodified character. */ public static final int convertEventToModifiedAccelerator(final Event event) { int modifiers = event.stateMask & SWT.MODIFIER_MASK; char character = topKey(event); return modifiers + toUpperCase(character); }
/** * <p> * Converts the given event into an SWT accelerator value -- considering the * modified character with the shift modifier. This is the third accelerator * value that should be checked when processing incoming key events. * </p> * <p> * For example, on a standard US keyboard, "Ctrl+Shift+5" would be viewed as * "Ctrl+Shift+%". * </p> * * @param event * The event to be converted; must not be <code>null</code>. * @return The combination of the state mask and the unmodified character. */ public static final int convertEventToModifiedAccelerator(final Event event) { int modifiers = event.stateMask & SWT.MODIFIER_MASK; char character = topKey(event); return modifiers + toUpperCase(character); }
/** * <p> * Converts the given event into an SWT accelerator value -- considering the * modified character with the shift modifier. This is the third accelerator * value that should be checked when processing incoming key events. * </p> * <p> * For example, on a standard US keyboard, "Ctrl+Shift+5" would be viewed as * "Ctrl+Shift+%". * </p> * * @param event * The event to be converted; must not be <code>null</code>. * @return The combination of the state mask and the unmodified character. */ public static final int convertEventToModifiedAccelerator(final Event event) { int modifiers = event.stateMask & SWT.MODIFIER_MASK; char character = topKey(event); return modifiers + toUpperCase(character); }
/** * Converts the given event into an SWT accelerator value -- considering the * modified character without the shift modifier. This is the second * accelerator value that should be checked when processing incoming key * events. Key strokes with alphabetic natural keys are run through * <code>convertEventToUnmodifiedAccelerator</code>. * * @param event * The event to be converted; must not be <code>null</code>. * @return The combination of the state mask without shift, and the modified * character. */ public static final int convertEventToUnshiftedModifiedAccelerator( final Event event) { // Disregard alphabetic key strokes. if (Character.isLetter((char) event.keyCode)) { return convertEventToUnmodifiedAccelerator(event); } int modifiers = event.stateMask & (SWT.MODIFIER_MASK ^ SWT.SHIFT); char character = topKey(event); return modifiers + toUpperCase(character); }
/** * Converts the given event into an SWT accelerator value -- considering the * modified character without the shift modifier. This is the second * accelerator value that should be checked when processing incoming key * events. Key strokes with alphabetic natural keys are run through * <code>convertEventToUnmodifiedAccelerator</code>. * * @param event * The event to be converted; must not be <code>null</code>. * @return The combination of the state mask without shift, and the modified * character. */ public static final int convertEventToUnshiftedModifiedAccelerator( final Event event) { // Disregard alphabetic key strokes. if (Character.isLetter((char) event.keyCode)) { return convertEventToUnmodifiedAccelerator(event); } int modifiers = event.stateMask & (SWT.MODIFIER_MASK ^ SWT.SHIFT); char character = topKey(event); return modifiers + toUpperCase(character); }
/** * Converts the given event into an SWT accelerator value -- considering the * modified character without the shift modifier. This is the second * accelerator value that should be checked when processing incoming key * events. Key strokes with alphabetic natural keys are run through * <code>convertEventToUnmodifiedAccelerator</code>. * * @param event * The event to be converted; must not be <code>null</code>. * @return The combination of the state mask without shift, and the modified * character. */ public static final int convertEventToUnshiftedModifiedAccelerator( final Event event) { // Disregard alphabetic key strokes. if (Character.isLetter((char) event.keyCode)) { return convertEventToUnmodifiedAccelerator(event); } int modifiers = event.stateMask & (SWT.MODIFIER_MASK ^ SWT.SHIFT); char character = topKey(event); return modifiers + toUpperCase(character); }