Skip to content

Commit a9fb9d0

Browse files
committed
add more shortcut
1 parent f1e0275 commit a9fb9d0

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

RevitPythonShell/Views/IronPythonConsole.xaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@
5050
SnapsToDevicePixels="True"
5151
Click="newFileClick" />
5252
<RibbonButton Label="Open" LargeImageSource="../Resources/Theme/Open.png"
53-
ToolTip="Open Python Script"
53+
ToolTip="Open (Ctrl + O)"
5454
Click="openFileClick" />
5555
<RibbonButton Label="Save" LargeImageSource="../Resources/Theme/Save.png"
56-
ToolTip="Save This Script Into File"
56+
ToolTip="Save (Ctrl + S)"
5757
Click="saveFileClick"
5858
SnapsToDevicePixels="True" />
5959
<RibbonButton Label="Save As" LargeImageSource="../Resources/Theme/SaveAs.png"
60-
ToolTip="Save As"
60+
ToolTip="Save As (Ctrl + Shift + S)"
6161
SnapsToDevicePixels="True"
6262
Click="saveAsFileClick" />
6363
</RibbonGroup>
@@ -109,7 +109,7 @@
109109
<RibbonButton Label="Run" LargeImageSource="../Resources/Theme/Run.png"
110110
SnapsToDevicePixels="True"
111111
Click="runClick"
112-
ToolTip="Run Script. Results will be displayed in the IronPython prompt." />
112+
ToolTip="(F5) Run Script. Results will be displayed in the IronPython prompt." />
113113
</RibbonGroup>
114114
</RibbonTab>
115115
</Ribbon>

RevitPythonShell/Views/IronPythonConsole.xaml.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,12 @@ private void runClick(object sender, EventArgs e)
107107
private void textEditor_PreviewKeyDown(object sender, KeyEventArgs e)
108108
{
109109
if (e.Key == Key.F5) RunStatements();
110+
if (e.Key == Key.S && Keyboard.Modifiers == ModifierKeys.Control) SaveFile();
111+
if (e.Key == Key.S && Keyboard.Modifiers == (ModifierKeys.Control | ModifierKeys.Shift)) saveAsFileClick(sender, e);
112+
if (e.Key == Key.O && Keyboard.Modifiers == ModifierKeys.Control) openFileClick(sender, e);
113+
if (e.Key == Key.N && Keyboard.Modifiers == ModifierKeys.Control) newFileClick(sender, e);
114+
if (e.Key == Key.F4 && Keyboard.Modifiers == ModifierKeys.Control) Close();
115+
110116
}
111117

112118
private void RunStatements()

0 commit comments

Comments
 (0)