private static String getSimplifiedMacKeyModifiersText(int modifiers) {
    StringBuilder buf = new StringBuilder();

    if ((modifiers & InputEvent.META_MASK) != 0)      buf.append("Cmd+");
    if ((modifiers & InputEvent.CTRL_MASK) != 0)      buf.append("Ctrl+");
    if ((modifiers & InputEvent.ALT_MASK) != 0)       buf.append("Alt+");
    if ((modifiers & InputEvent.SHIFT_MASK) != 0)     buf.append("Shift+");
    if ((modifiers & InputEvent.ALT_GRAPH_MASK) != 0) buf.append("Alt Graph+");
    if ((modifiers & InputEvent.BUTTON1_MASK) != 0)   buf.append("Button1+");

    if (buf.length() > 0) buf.setLength(buf.length() - 1);

    return buf.toString();
  }
private static String getSimplifiedMacKeyModifiersText(int modifiers)