Here you can find the source of keyEventModifiersToKeyStrokeModifiers(int modifiers)
public static int keyEventModifiersToKeyStrokeModifiers(int modifiers)
//package com.java2s; //License from project: Open Source License import java.awt.event.InputEvent; public class Main { public static int keyEventModifiersToKeyStrokeModifiers(int modifiers) { int shift = InputEvent.SHIFT_DOWN_MASK | InputEvent.SHIFT_MASK; int ctrl = InputEvent.CTRL_DOWN_MASK | InputEvent.CTRL_MASK; int alt = InputEvent.ALT_DOWN_MASK | InputEvent.ALT_MASK; switch (modifiers) { case 1://from w w w. j a v a2 s. c o m return shift; case 2: return ctrl; case 3: return shift | ctrl; case 8: return alt; case 9: return shift | alt; case 10: return ctrl | alt; case 11: return ctrl | shift | alt; } return 0; } }