Skip to content

Commit

Permalink
only swallow save keypresses
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinushey committed Oct 8, 2015
1 parent caf6cee commit 803cfc9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -432,15 +432,13 @@ private boolean shouldSwallowEvent(NativeEvent e)
KeyCombination keys = new KeyCombination(e);
int keyCode = keys.getKeyCode();

boolean isSaveQuitKey =
keyCode == KeyCodes.KEY_S ||
keyCode == KeyCodes.KEY_W;
boolean isSaveKey = keyCode == KeyCodes.KEY_S;

boolean isSaveQuitModifier = BrowseCap.isMacintosh() ?
boolean isSaveModifier = BrowseCap.isMacintosh() ?
keys.getModifier() == KeyboardShortcut.META :
keys.getModifier() == KeyboardShortcut.CTRL;

return isSaveQuitKey && isSaveQuitModifier;
return isSaveKey && isSaveModifier;
}

private int disableCount_ = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,7 @@ well as menu structures (for main menu and popup menus).
<shortcut value="F1" title="Show Function Help" />
<shortcut value="F2" title="Go To Function / File"/>
<shortcut value="Tab" title="Complete Code" />
<shortcut refid="quitSession" value="Ctrl+X Ctrl+C" disableModes="default,vim"/>
<shortcut refid="quitSession" value="Cmd+Q" if="org.rstudio.studio.client.application.Desktop.isDesktop()"/>
<shortcut refid="restartR" value="Cmd+Shift+0" if="org.rstudio.core.client.BrowseCap.isMacintosh()"/>
<shortcut refid="restartR" value="Cmd+Shift+F10"/>
Expand Down

0 comments on commit 803cfc9

Please sign in to comment.