Skip to content

Commit

Permalink
Added OnKeyDown and OnKeyUp to Tool.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
CPKreu committed Nov 30, 2020
1 parent bd303b5 commit d2dc1c7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions PixiEditor/Models/Tools/Tool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ public virtual void OnMouseUp(MouseEventArgs e)
{
}

public virtual void OnKeyDown(KeyEventArgs e)
{
}

public virtual void OnKeyUp(KeyEventArgs e)
{
}

public virtual void OnRecordingLeftMouseDown(MouseEventArgs e)
{
}
Expand Down
3 changes: 3 additions & 0 deletions PixiEditor/ViewModels/SubViewModels/Main/IoViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public void KeyDown(object parameter)
}

Owner.ShortcutController.KeyPressed(args.Key, Keyboard.Modifiers);
Owner.BitmapManager.SelectedTool.OnKeyDown(args);
}

private void MouseDown(object parameter)
Expand Down Expand Up @@ -135,6 +136,8 @@ private void KeyUp(object parameter)
Owner.ToolsSubViewModel.SetActiveTool(Owner.ToolsSubViewModel.LastActionTool);
ShortcutController.BlockShortcutExecution = false;
}

Owner.BitmapManager.SelectedTool.OnKeyUp(args);
}
}
}

0 comments on commit d2dc1c7

Please sign in to comment.