Allow moving pinned images with arrow keys
This commit is contained in:
parent
6a28815bd6
commit
ec56715b3b
@ -79,6 +79,7 @@
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
|
||||
this.Name = "PinToScreenForm";
|
||||
this.ShowInTaskbar = false;
|
||||
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.PinToScreenForm_KeyDown);
|
||||
this.KeyUp += new System.Windows.Forms.KeyEventHandler(this.PinToScreenForm_KeyUp);
|
||||
this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.PinToScreenForm_MouseDown);
|
||||
this.MouseEnter += new System.EventHandler(this.PinToScreenForm_MouseEnter);
|
||||
|
@ -531,6 +531,27 @@ namespace ShareX
|
||||
UpdateControls();
|
||||
}
|
||||
|
||||
private void PinToScreenForm_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
int speed = e.Shift ? 10 : 1;
|
||||
|
||||
switch (e.KeyCode)
|
||||
{
|
||||
case Keys.Left:
|
||||
Location = new Point(Location.X - speed, Location.Y);
|
||||
break;
|
||||
case Keys.Right:
|
||||
Location = new Point(Location.X + speed, Location.Y);
|
||||
break;
|
||||
case Keys.Up:
|
||||
Location = new Point(Location.X, Location.Y - speed);
|
||||
break;
|
||||
case Keys.Down:
|
||||
Location = new Point(Location.X, Location.Y + speed);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void PinToScreenForm_KeyUp(object sender, KeyEventArgs e)
|
||||
{
|
||||
switch (e.KeyData)
|
||||
|
@ -171,7 +171,7 @@
|
||||
<value>3, 2, 1, 1</value>
|
||||
</data>
|
||||
<data name="tsMain.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>174, 34</value>
|
||||
<value>143, 34</value>
|
||||
</data>
|
||||
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="tsMain.TabIndex" type="System.Int32, mscorlib">
|
||||
@ -181,7 +181,7 @@
|
||||
<value>tsMain</value>
|
||||
</data>
|
||||
<data name=">>tsMain.Type" xml:space="preserve">
|
||||
<value>ShareX.HelpersLib.ToolStripEx, ShareX.HelpersLib, Version=16.0.1.0, Culture=neutral, PublicKeyToken=null</value>
|
||||
<value>ShareX.HelpersLib.ToolStripEx, ShareX.HelpersLib, Version=17.0.1.0, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>tsMain.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
|
Loading…
x
Reference in New Issue
Block a user