mirror of
https://github.com/ShareX/ShareX.git
synced 2024-09-30 01:07:21 +13:00
Added copy file (shift + c), copy image (alt + c), edit image (ctrl + e) hotkeys to history forms
This commit is contained in:
parent
61c44bc0bd
commit
0f4b7a4eee
3 changed files with 32 additions and 32 deletions
|
@ -508,22 +508,7 @@ private void lvHistory_MouseDoubleClick(object sender, MouseEventArgs e)
|
|||
|
||||
private void lvHistory_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
switch (e.KeyData)
|
||||
{
|
||||
default:
|
||||
return;
|
||||
case Keys.Enter:
|
||||
him.TryOpen();
|
||||
break;
|
||||
case Keys.Control | Keys.Enter:
|
||||
him.OpenFile();
|
||||
break;
|
||||
case Keys.Control | Keys.C:
|
||||
him.CopyURL();
|
||||
break;
|
||||
}
|
||||
|
||||
e.Handled = true;
|
||||
e.Handled = e.SuppressKeyPress = him.HandleKeyInput(e);
|
||||
}
|
||||
|
||||
private void lvHistory_ItemDrag(object sender, ItemDragEventArgs e)
|
||||
|
|
|
@ -241,22 +241,7 @@ private void tsbSettings_Click(object sender, EventArgs e)
|
|||
|
||||
private void ilvImages_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
switch (e.KeyData)
|
||||
{
|
||||
default:
|
||||
return;
|
||||
case Keys.Enter:
|
||||
him.OpenURL();
|
||||
break;
|
||||
case Keys.Control | Keys.Enter:
|
||||
him.OpenFile();
|
||||
break;
|
||||
case Keys.Control | Keys.C:
|
||||
him.CopyURL();
|
||||
break;
|
||||
}
|
||||
|
||||
e.Handled = true;
|
||||
e.Handled = e.SuppressKeyPress = him.HandleKeyInput(e);
|
||||
}
|
||||
|
||||
#endregion Form events
|
||||
|
|
|
@ -27,6 +27,7 @@ You should have received a copy of the GNU General Public License
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace ShareX.HistoryLib
|
||||
{
|
||||
|
@ -107,6 +108,35 @@ public HistoryItem[] OnGetHistoryItems()
|
|||
return null;
|
||||
}
|
||||
|
||||
public bool HandleKeyInput(KeyEventArgs e)
|
||||
{
|
||||
switch (e.KeyData)
|
||||
{
|
||||
default:
|
||||
return false;
|
||||
case Keys.Enter:
|
||||
TryOpen();
|
||||
break;
|
||||
case Keys.Control | Keys.Enter:
|
||||
OpenFile();
|
||||
break;
|
||||
case Keys.Control | Keys.C:
|
||||
CopyURL();
|
||||
break;
|
||||
case Keys.Shift | Keys.C:
|
||||
CopyFile();
|
||||
break;
|
||||
case Keys.Alt | Keys.C:
|
||||
CopyImage();
|
||||
break;
|
||||
case Keys.Control | Keys.E:
|
||||
EditImage();
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void OpenURL()
|
||||
{
|
||||
if (HistoryItem != null && IsURLExist) URLHelpers.OpenURL(HistoryItem.URL);
|
||||
|
|
Loading…
Reference in a new issue