mirror of
https://github.com/ShareX/ShareX.git
synced 2024-08-15 10:12:12 +12:00
Use space bar to open menu instead of mouse 3
This commit is contained in:
parent
81a11f94b8
commit
a6e840f766
2 changed files with 16 additions and 7 deletions
|
@ -181,9 +181,6 @@ private void Surface_KeyUp(object sender, KeyEventArgs e)
|
||||||
case Keys.Escape:
|
case Keys.Escape:
|
||||||
Close(SurfaceResult.Close);
|
Close(SurfaceResult.Close);
|
||||||
break;
|
break;
|
||||||
case Keys.Space:
|
|
||||||
Close(SurfaceResult.Fullscreen);
|
|
||||||
break;
|
|
||||||
case Keys.Enter:
|
case Keys.Enter:
|
||||||
Close(SurfaceResult.Region);
|
Close(SurfaceResult.Region);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -164,6 +164,13 @@ public AreaManager(RectangleRegionForm surface)
|
||||||
private void CreateShapeMenu()
|
private void CreateShapeMenu()
|
||||||
{
|
{
|
||||||
cmsShapeMenu = new ContextMenuStrip();
|
cmsShapeMenu = new ContextMenuStrip();
|
||||||
|
cmsShapeMenu.KeyDown += (sender, e) =>
|
||||||
|
{
|
||||||
|
if (e.KeyCode == Keys.Space)
|
||||||
|
{
|
||||||
|
cmsShapeMenu.Close();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
foreach (ShapeType shapeType in Helpers.GetEnums<ShapeType>())
|
foreach (ShapeType shapeType in Helpers.GetEnums<ShapeType>())
|
||||||
{
|
{
|
||||||
|
@ -234,6 +241,12 @@ private void CreateShapeMenu()
|
||||||
|
|
||||||
cmsShapeMenu.Items.Add(new ToolStripSeparator());
|
cmsShapeMenu.Items.Add(new ToolStripSeparator());
|
||||||
|
|
||||||
|
ToolStripMenuItem tsmiFullscreenCapture = new ToolStripMenuItem("Capture fullscreen");
|
||||||
|
tsmiFullscreenCapture.Click += (sender, e) => surface.Close(SurfaceResult.Fullscreen);
|
||||||
|
cmsShapeMenu.Items.Add(tsmiFullscreenCapture);
|
||||||
|
|
||||||
|
cmsShapeMenu.Items.Add(new ToolStripSeparator());
|
||||||
|
|
||||||
ToolStripMenuItem tsmiCloseMenu = new ToolStripMenuItem("Close");
|
ToolStripMenuItem tsmiCloseMenu = new ToolStripMenuItem("Close");
|
||||||
tsmiCloseMenu.Click += (sender, e) => cmsShapeMenu.Close();
|
tsmiCloseMenu.Click += (sender, e) => cmsShapeMenu.Close();
|
||||||
cmsShapeMenu.Items.Add(tsmiCloseMenu);
|
cmsShapeMenu.Items.Add(tsmiCloseMenu);
|
||||||
|
@ -328,6 +341,9 @@ private void surface_KeyDown(object sender, KeyEventArgs e)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case Keys.Space:
|
||||||
|
cmsShapeMenu.Show(Cursor.Position.X, Cursor.Position.Y);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -522,10 +538,6 @@ private void surface_MouseUp(object sender, MouseEventArgs e)
|
||||||
EndRegionSelection();
|
EndRegionSelection();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (e.Button == MouseButtons.Middle)
|
|
||||||
{
|
|
||||||
cmsShapeMenu.Show(surface, e.Location);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void RegionSelection(Point location)
|
private void RegionSelection(Point location)
|
||||||
|
|
Loading…
Reference in a new issue