Shortcut (String s) { if (s.equals("Force touch")) { return KeymapUtil.parseMouseShortcut(s); } else if (s.contains("button")) { return KeymapUtil.parseMouseShortcut(s); } else { String[] sc = s.split(","); assert sc.length <= 2 : s; KeyStroke fst = KeyStrokeAdapter.getKeyStroke(sc[0]); assert fst != null : s; KeyStroke snd = null; if (sc.length == 2) { snd = KeyStrokeAdapter.getKeyStroke(sc[1]); } return new KeyboardShortcut(fst, snd); } }