views:

564

answers:

2

Just wondered if anyone could give me some advice on the best way to implement keyboard shortcuts within a Silverlight based project.

Can this be done from the xaml or is it best implemented within the code behind etc...

Thanks in advance.

+1  A: 

I do it by adding an event handler on the UserControl I'm making. Keys that aren't handled by other controls bubble up to the UserControl, and then you can handle it there via the code behind.

You can define your event handler in the XAML, but you need to implement it in the code behind

Cheers

Nik

niklassaers-vc
+1  A: 

A decent tutorial on keyboard capture aimed at games

Graeme Bradbury