File tree Expand file tree Collapse file tree
app/src/processing/app/ui Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -260,6 +260,19 @@ public void paintComponent(Graphics g) {
260260 textarea .setRightClickPopup (new TextAreaPopup ());
261261 textarea .setHorizontalOffset (JEditTextArea .leftHandGutter );
262262
263+ { // Hack: add Numpad Slash as an alternative shortcut for Comment/Uncomment
264+ int modifiers = Toolkit .awtToolkit .getMenuShortcutKeyMask ();
265+ KeyStroke keyStroke = KeyStroke .getKeyStroke (KeyEvent .VK_DIVIDE , modifiers );
266+ final String ACTION_KEY = "COMMENT_UNCOMMENT_ALT" ;
267+ textarea .getInputMap ().put (keyStroke , ACTION_KEY );
268+ textarea .getActionMap ().put (ACTION_KEY , new AbstractAction () {
269+ @ Override
270+ public void actionPerformed (ActionEvent e ) {
271+ handleCommentUncomment ();
272+ }
273+ });
274+ }
275+
263276 footer = createFooter ();
264277
265278 upper .add (textarea );
You can’t perform that action at this time.
0 commit comments