String (@NotNull MouseShortcut shortcut) { if (shortcut instanceof PressureShortcut) { return "Force touch"; } StringBuilder buffer = new StringBuilder(); // modifiers int modifiers = shortcut.getModifiers(); if ((InputEvent.SHIFT_DOWN_MASK & modifiers) > 0) { buffer.append(SHIFT); buffer.append(' '); } if ((InputEvent.CTRL_DOWN_MASK & modifiers) > 0) { buffer.append(CONTROL); buffer.append(' '); } if ((InputEvent.META_DOWN_MASK & modifiers) > 0) { buffer.append(META); buffer.append(' '); } if ((InputEvent.ALT_DOWN_MASK & modifiers) > 0) { buffer.append(ALT); buffer.append(' '); } if ((InputEvent.ALT_GRAPH_DOWN_MASK & modifiers) > 0) { buffer.append(ALT_GRAPH); buffer.append(' '); } // button buffer.append("button").append(shortcut.getButton()).append(' '); if (shortcut.getClickCount() > 1) { buffer.append(DOUBLE_CLICK); } return buffer.toString().trim(); // trim trailing space (if any) }