mirror of
https://github.com/ShareX/ShareX.git
synced 2024-07-07 07:26:05 +12:00
In region capture menu key will open right click menu
This commit is contained in:
parent
b0e0465513
commit
fefcf2cf26
|
@ -426,7 +426,7 @@ protected virtual void WriteTips(StringBuilder sb)
|
|||
|
||||
if (Mode == RectangleRegionMode.Annotation)
|
||||
{
|
||||
sb.AppendLine("[Right click] Open options menu");
|
||||
sb.AppendLine("[Right click][Menu] Open options menu");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -829,7 +829,7 @@ private void form_MouseUp(object sender, MouseEventArgs e)
|
|||
}
|
||||
else if (form.Mode == RectangleRegionMode.Annotation)
|
||||
{
|
||||
RunRegionCaptureAction(Config.MouseRightClickAction);
|
||||
RunAction(Config.MouseRightClickAction);
|
||||
}
|
||||
else if (IsShapeIntersect())
|
||||
{
|
||||
|
@ -842,15 +842,15 @@ private void form_MouseUp(object sender, MouseEventArgs e)
|
|||
}
|
||||
else if (e.Button == MouseButtons.Middle)
|
||||
{
|
||||
RunRegionCaptureAction(Config.MouseMiddleClickAction);
|
||||
RunAction(Config.MouseMiddleClickAction);
|
||||
}
|
||||
else if (e.Button == MouseButtons.XButton1)
|
||||
{
|
||||
RunRegionCaptureAction(Config.Mouse4ClickAction);
|
||||
RunAction(Config.Mouse4ClickAction);
|
||||
}
|
||||
else if (e.Button == MouseButtons.XButton2)
|
||||
{
|
||||
RunRegionCaptureAction(Config.Mouse5ClickAction);
|
||||
RunAction(Config.Mouse5ClickAction);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -990,10 +990,13 @@ private void form_KeyUp(object sender, KeyEventArgs e)
|
|||
EndRegionSelection();
|
||||
}
|
||||
break;
|
||||
case Keys.Apps:
|
||||
OpenOptionsMenu();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void RunRegionCaptureAction(RegionCaptureAction action)
|
||||
private void RunAction(RegionCaptureAction action)
|
||||
{
|
||||
switch (action)
|
||||
{
|
||||
|
@ -1011,23 +1014,13 @@ private void RunRegionCaptureAction(RegionCaptureAction action)
|
|||
}
|
||||
break;
|
||||
case RegionCaptureAction.RemoveShape:
|
||||
if (IsShapeIntersect())
|
||||
{
|
||||
DeleteIntersectShape();
|
||||
}
|
||||
DeleteIntersectShape();
|
||||
break;
|
||||
case RegionCaptureAction.OpenOptionsMenu:
|
||||
if (form.Mode == RectangleRegionMode.Annotation && cmsContextMenu != null)
|
||||
{
|
||||
cmsContextMenu.Show(form, InputManager.MousePosition0Based.Add(-10, -10));
|
||||
Config.ShowMenuTip = false;
|
||||
}
|
||||
OpenOptionsMenu();
|
||||
break;
|
||||
case RegionCaptureAction.SwapToolType:
|
||||
if (form.Mode == RectangleRegionMode.Annotation)
|
||||
{
|
||||
SwapShapeType();
|
||||
}
|
||||
SwapShapeType();
|
||||
break;
|
||||
case RegionCaptureAction.CaptureFullscreen:
|
||||
form.Close(RegionResult.Fullscreen);
|
||||
|
@ -1257,13 +1250,25 @@ private void UpdateCurrentShape()
|
|||
|
||||
private void SwapShapeType()
|
||||
{
|
||||
if (IsCurrentShapeTypeRegion)
|
||||
if (form.Mode == RectangleRegionMode.Annotation)
|
||||
{
|
||||
CurrentShapeType = Config.LastAnnotationTool;
|
||||
if (IsCurrentShapeTypeRegion)
|
||||
{
|
||||
CurrentShapeType = Config.LastAnnotationTool;
|
||||
}
|
||||
else
|
||||
{
|
||||
CurrentShapeType = Config.LastRegionTool;
|
||||
}
|
||||
}
|
||||
else
|
||||
}
|
||||
|
||||
private void OpenOptionsMenu()
|
||||
{
|
||||
if (form.Mode == RectangleRegionMode.Annotation && cmsContextMenu != null)
|
||||
{
|
||||
CurrentShapeType = Config.LastRegionTool;
|
||||
cmsContextMenu.Show(form, InputManager.MousePosition0Based.Add(-10, -10));
|
||||
Config.ShowMenuTip = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue