mirror of
https://github.com/ShareX/ShareX.git
synced 2024-09-30 01:07:21 +13:00
Added "Stop screen recording" hotkey
This commit is contained in:
parent
25b2e6b474
commit
4bfc9ce071
9 changed files with 58 additions and 8 deletions
18
ShareX.HelpersLib/Properties/Resources.Designer.cs
generated
18
ShareX.HelpersLib/Properties/Resources.Designer.cs
generated
|
@ -2082,6 +2082,24 @@ internal static string HotkeyType_StartScreenRecorderGIF_Category {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Stop screen recording.
|
||||||
|
/// </summary>
|
||||||
|
internal static string HotkeyType_StopScreenRecording {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("HotkeyType_StopScreenRecording", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Screen record.
|
||||||
|
/// </summary>
|
||||||
|
internal static string HotkeyType_StopScreenRecording_Category {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("HotkeyType_StopScreenRecording_Category", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Stop all active uploads.
|
/// Looks up a localized string similar to Stop all active uploads.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -1373,4 +1373,10 @@ Would you like to download and install it?</value>
|
||||||
<data name="RegionCaptureAction_CaptureLastRegion" xml:space="preserve">
|
<data name="RegionCaptureAction_CaptureLastRegion" xml:space="preserve">
|
||||||
<value>Capture last region</value>
|
<value>Capture last region</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="HotkeyType_StopScreenRecording" xml:space="preserve">
|
||||||
|
<value>Stop screen recording</value>
|
||||||
|
</data>
|
||||||
|
<data name="HotkeyType_StopScreenRecording_Category" xml:space="preserve">
|
||||||
|
<value>Screen record</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
|
@ -203,6 +203,7 @@ public enum HotkeyType // Localized + Category
|
||||||
ScreenRecorderGIFActiveWindow,
|
ScreenRecorderGIFActiveWindow,
|
||||||
ScreenRecorderGIFCustomRegion,
|
ScreenRecorderGIFCustomRegion,
|
||||||
StartScreenRecorderGIF,
|
StartScreenRecorderGIF,
|
||||||
|
StopScreenRecording,
|
||||||
AbortScreenRecording,
|
AbortScreenRecording,
|
||||||
// Tools
|
// Tools
|
||||||
ColorPicker,
|
ColorPicker,
|
||||||
|
|
10
ShareX/Properties/Resources.Designer.cs
generated
10
ShareX/Properties/Resources.Designer.cs
generated
|
@ -797,6 +797,16 @@ public static System.Drawing.Bitmap camcorder__exclamation {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
public static System.Drawing.Bitmap camcorder__minus {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("camcorder__minus", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -1103,4 +1103,7 @@ Middle click to close</value>
|
||||||
<data name="application-resize-full" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="application-resize-full" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\application-resize-full.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Resources\application-resize-full.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="camcorder__minus" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\camcorder--minus.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
BIN
ShareX/Resources/camcorder--minus.png
Normal file
BIN
ShareX/Resources/camcorder--minus.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 636 B |
|
@ -56,6 +56,14 @@ public static void StartStopRecording(ScreenRecordOutput outputType, ScreenRecor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void StopRecording()
|
||||||
|
{
|
||||||
|
if (IsRecording && screenRecorder != null)
|
||||||
|
{
|
||||||
|
screenRecorder.StopRecording();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void AbortRecording()
|
public static void AbortRecording()
|
||||||
{
|
{
|
||||||
if (IsRecording && recordForm != null && !recordForm.IsDisposed)
|
if (IsRecording && recordForm != null && !recordForm.IsDisposed)
|
||||||
|
@ -64,14 +72,6 @@ public static void AbortRecording()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void StopRecording()
|
|
||||||
{
|
|
||||||
if (IsRecording && screenRecorder != null)
|
|
||||||
{
|
|
||||||
screenRecorder.StopRecording();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void StartRecording(ScreenRecordOutput outputType, TaskSettings taskSettings, ScreenRecordStartMethod startMethod = ScreenRecordStartMethod.Region)
|
private static void StartRecording(ScreenRecordOutput outputType, TaskSettings taskSettings, ScreenRecordStartMethod startMethod = ScreenRecordStartMethod.Region)
|
||||||
{
|
{
|
||||||
if (outputType == ScreenRecordOutput.GIF)
|
if (outputType == ScreenRecordOutput.GIF)
|
||||||
|
|
|
@ -1934,6 +1934,9 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="Resources\application-resize-full.png" />
|
<None Include="Resources\application-resize-full.png" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="Resources\camcorder--minus.png" />
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<PostBuildEvent>
|
<PostBuildEvent>
|
||||||
|
|
|
@ -163,6 +163,9 @@ public static void ExecuteJob(TaskSettings taskSettings, HotkeyType job, CLIComm
|
||||||
case HotkeyType.StartScreenRecorderGIF:
|
case HotkeyType.StartScreenRecorderGIF:
|
||||||
StartScreenRecording(ScreenRecordOutput.GIF, ScreenRecordStartMethod.LastRegion, safeTaskSettings);
|
StartScreenRecording(ScreenRecordOutput.GIF, ScreenRecordStartMethod.LastRegion, safeTaskSettings);
|
||||||
break;
|
break;
|
||||||
|
case HotkeyType.StopScreenRecording:
|
||||||
|
StopScreenRecording();
|
||||||
|
break;
|
||||||
case HotkeyType.AbortScreenRecording:
|
case HotkeyType.AbortScreenRecording:
|
||||||
AbortScreenRecording();
|
AbortScreenRecording();
|
||||||
break;
|
break;
|
||||||
|
@ -594,6 +597,11 @@ public static void StartScreenRecording(ScreenRecordOutput outputType, ScreenRec
|
||||||
ScreenRecordManager.StartStopRecording(outputType, startMethod, taskSettings);
|
ScreenRecordManager.StartStopRecording(outputType, startMethod, taskSettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void StopScreenRecording()
|
||||||
|
{
|
||||||
|
ScreenRecordManager.StopRecording();
|
||||||
|
}
|
||||||
|
|
||||||
public static void AbortScreenRecording()
|
public static void AbortScreenRecording()
|
||||||
{
|
{
|
||||||
ScreenRecordManager.AbortRecording();
|
ScreenRecordManager.AbortRecording();
|
||||||
|
@ -1482,6 +1490,7 @@ public static Image FindMenuIcon<T>(T value) where T : Enum
|
||||||
case HotkeyType.ScreenRecorderGIFActiveWindow: return Resources.film__arrow;
|
case HotkeyType.ScreenRecorderGIFActiveWindow: return Resources.film__arrow;
|
||||||
case HotkeyType.ScreenRecorderGIFCustomRegion: return Resources.film__arrow;
|
case HotkeyType.ScreenRecorderGIFCustomRegion: return Resources.film__arrow;
|
||||||
case HotkeyType.StartScreenRecorderGIF: return Resources.film__arrow;
|
case HotkeyType.StartScreenRecorderGIF: return Resources.film__arrow;
|
||||||
|
case HotkeyType.StopScreenRecording: return Resources.camcorder__minus;
|
||||||
case HotkeyType.AbortScreenRecording: return Resources.camcorder__exclamation;
|
case HotkeyType.AbortScreenRecording: return Resources.camcorder__exclamation;
|
||||||
// Tools
|
// Tools
|
||||||
case HotkeyType.ColorPicker: return Resources.color;
|
case HotkeyType.ColorPicker: return Resources.color;
|
||||||
|
|
Loading…
Reference in a new issue