Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic KeyDown Events (Read 1855 times)
Hunter
Full Member
***
Offline



Posts: 194
Location: Sevastopol
Joined: Dec 1st, 2009
KeyDown Events
Dec 24th, 2009 at 11:24am
Print Post  
Hello. I have the problem Smiley. I can't catch events when user press any arrow key such as: Left, Right, Up, Down, NumPad4, NumPad6, NumPad2, NumPad8. But any other key press events I catch in my event handler:
Code
Select All
	  private void OnDiagram_KeyDown(object sender, KeyEventArgs e)
	  {
		switch (e.Key)
		{
		    case Key.Escape:
			  ClearSelection();
			  break;
		    case Key.Left:
			  MoveSelectionLeft(5);
			  break;
		    case Key.Right:
			  MoveSelectionRight(5);
			  break;
		    case Key.Up:
			  MoveSelectionUp(5);
			  break;
		    case Key.Down:
			  MoveSelectionDown(5);
			  break;
		}
	  }
 


I suppose that the Diagram class catches these evetns. How can I switch off this feature for catching these events in my code?
The goal is moving selected nodes when user presses or toggles arrow buttons.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: KeyDown Events
Reply #1 - Dec 24th, 2009 at 12:02pm
Print Post  
Hi,

Right, the diagram has some default bindings to these keys. You can override them as shown here -
http://mindfusion.eu/Forum/YaBB.pl?board=wpfdg_disc;action=display;num=123874209...

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Hunter
Full Member
***
Offline



Posts: 194
Location: Sevastopol
Joined: Dec 1st, 2009
Re: KeyDown Events
Reply #2 - Dec 24th, 2009 at 12:53pm
Print Post  
Thank you very much!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint