String (@Nullable InputEvent inputEvent, @Nullable String place) { if (inputEvent instanceof KeyEvent) { // touchbar uses KeyEvent to perform an action if (ActionPlaces.TOUCHBAR_GENERAL.equals(place)) { return "Touchbar"; } return getKeyEventText((KeyEvent)inputEvent); } else if (inputEvent instanceof MouseEvent) { return getMouseEventText((MouseEvent)inputEvent); } return null; }