Skip to content

Commit

Permalink
Enh : shift/CapsLock + MouseWheel to rotate between pens
Browse files Browse the repository at this point in the history
rotate between pens with shift pressed of with caps lock toggled on
issue #59
  • Loading branch information
pubpub-zz authored and CDa@localhost committed Mar 10, 2021
1 parent 889260a commit 52f25df
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/FormCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -960,6 +960,24 @@ private void IC_MouseWheel(object sender, CancelMouseEventArgs e)
ZoomForm.Width += t*10;
return;
}
if (((GetKeyState(VK_LSHIFT ) | GetKeyState(VK_RSHIFT)) & 0x8000)!= 0 || System.Windows.Input.Keyboard.IsKeyToggled(System.Windows.Input.Key.CapsLock))
{
int p = LastPenSelected + (e.Delta>0?1:-1);
if (p >= Root.MaxPenCount)
p = 0;
if (p < 0)
p = Root.MaxPenCount - 1;
while (!Root.PenEnabled[p])
{
p += (e.Delta > 0 ? 1 : -1);
if (p >= Root.MaxPenCount)
p = 0;
if (p < 0)
p = Root.MaxPenCount - 1;
}
SelectPen(p);
return;
}
Root.GlobalPenWidth += Root.PixelToHiMetric(e.Delta > 0 ? 2 : -2);
if (Root.GlobalPenWidth < 1)
Root.GlobalPenWidth = 1;
Expand Down

0 comments on commit 52f25df

Please sign in to comment.