File tree Expand file tree Collapse file tree 4 files changed +22
-11
lines changed
src/org/rstudio/studio/client/workbench Expand file tree Collapse file tree 4 files changed +22
-11
lines changed Original file line number Diff line number Diff line change @@ -407,7 +407,7 @@ well as menu structures (for main menu and popup menus).
407407 <shortcut value =" Ctrl+Y" title =" Insert Yanked Text" />
408408 <shortcut value =" Ctrl+T" title =" Transpose Letters" if =" org.rstudio.core.client.BrowseCap.isMacintosh()" />
409409 <shortcut value =" Alt+-" title =" Insert Assignment Operator" />
410- <shortcut value =" Shift+Alt+. " title =" Insert Pipe Operator" />
410+ <shortcut value =" Cmd+ Shift+M " title =" Insert Pipe Operator" />
411411 </shortcutgroup >
412412 <shortcutgroup name =" Source Navigation" >
413413 <shortcut refid =" sourceNavigateBack" value =" Cmd+F9" />
Original file line number Diff line number Diff line change 2222import com .google .gwt .event .dom .client .*;
2323import com .google .gwt .user .client .Command ;
2424import com .google .inject .Inject ;
25+
26+ import org .rstudio .core .client .BrowseCap ;
2527import org .rstudio .core .client .CommandWithArg ;
2628import org .rstudio .core .client .StringUtil ;
2729import org .rstudio .core .client .command .CommandBinder ;
@@ -531,13 +533,19 @@ else if (mod == KeyboardShortcut.ALT)
531533 break ;
532534 }
533535 }
534- else if (mod == (KeyboardShortcut .ALT + KeyboardShortcut .SHIFT ))
536+ else if (
537+ BrowseCap .hasMetaKey () &&
538+ (mod == (KeyboardShortcut .META + KeyboardShortcut .SHIFT )) ||
539+ !BrowseCap .hasMetaKey () &&
540+ (mod == (KeyboardShortcut .CTRL + KeyboardShortcut .SHIFT )))
535541 {
536- if (keyCode == 190 )
542+ switch (keyCode )
537543 {
538- event .preventDefault ();
539- event .stopPropagation ();
540- input_ .replaceSelection (" %>% " , true );
544+ case KeyCodes .KEY_M :
545+ event .preventDefault ();
546+ event .stopPropagation ();
547+ input_ .replaceSelection (" %>% " , true );
548+ break ;
541549 }
542550 }
543551 }
Original file line number Diff line number Diff line change @@ -386,6 +386,7 @@ public void onKeyDown(KeyDownEvent event)
386386 {
387387 NativeEvent ne = event .getNativeEvent ();
388388 int mod = KeyboardShortcut .getModifierValue (ne );
389+
389390 if ((mod == KeyboardShortcut .META || (mod == KeyboardShortcut .CTRL && !BrowseCap .hasMetaKey ()))
390391 && ne .getKeyCode () == 'F' )
391392 {
@@ -431,9 +432,11 @@ else if ((ne.getKeyCode() == KeyCodes.KEY_ESCAPE) &&
431432 event .stopPropagation ();
432433 commands_ .interruptR ().execute ();
433434 }
434-
435- else if (mod == (KeyboardShortcut .ALT + KeyboardShortcut .SHIFT )
436- && ne .getKeyCode () == 190 ) // period
435+ else if (ne .getKeyCode () == KeyCodes .KEY_M &&
436+ (BrowseCap .hasMetaKey () &&
437+ mod == (KeyboardShortcut .META + KeyboardShortcut .SHIFT )) ||
438+ (!BrowseCap .hasMetaKey () &&
439+ mod == (KeyboardShortcut .CTRL + KeyboardShortcut .SHIFT )))
437440 {
438441 event .preventDefault ();
439442 event .stopPropagation ();
Original file line number Diff line number Diff line change @@ -493,8 +493,8 @@ <h2>Keyboard Shortcuts</h2>
493493 </ tr >
494494 < tr >
495495 < td > Insert pipe operator</ td >
496- < td > Shift+Alt+. </ td >
497- < td > Option+Alt+. </ td >
496+ < td > Ctrl+ Shift+M </ td >
497+ < td > Cmd+Shift+M </ td >
498498 </ tr >
499499 < tr >
500500 < td > Show help for function at cursor</ td >
You can’t perform that action at this time.
0 commit comments