Hello I am running IronPython 2.7A and trying to debug a Silverlight app. I am trying to figure out why my ship doesn&#39;t move when I press the Arrow keys.<br><br>here is the complete source minus most imports :D<br><br>
Any ideas<br><br>from System.Windows.Input import *<br><br><br>velocity = 10<br><br>class Gui():<br>    def __init__(self):<br>        <br>        self.grid = Grid()<br>        self.canvas = Canvas(Background = SolidColorBrush(Colors.White))<br>
        self.canvas.Width = 640<br>        self.canvas.Height = 432<br>        self.bgImage = Image(<br>            Source = BitmapImage(Uri(&quot;images/background.jpg&quot;, UriKind.Relative))<br>            )<br>        self.canvas.SetTop(self.bgImage, 132)<br>
        self.canvas.SetLeft(self.bgImage, 0)<br>#        self.textblock = TextBlock()<br>##        self.textblock.FontSize = 24<br>##        self.textblock.Text = &#39;This Really Works!!&#39;<br>##        self.canvas.Children.Add(self.textblock)<br>
<br>        self.ship = Image(<br>            Source = BitmapImage(Uri(&quot;images/ship.png&quot;, UriKind.Relative))<br>            )<br>        <br>        self.canvas.SetTop(self.ship, 75)<br>        self.canvas.SetLeft(self.ship, 25)<br>
<br>        CompositionTarget.Rendering += EventHandler(self.ShootBG)<br>##        self.GenerateStarField(350)<br>        <br>        self.canvas.Children.Add(self.bgImage)<br><br>        self.canvas.Children.Add(self.ship) <br>
        self.grid.Children.Add(self.canvas)<br>        Application.Current.RootVisual = self.grid<br>        # This line should be something different Not sure what to use instead of this<br>        self.ship.KeyDown += KeyEventHandler(self.KeyDown_Control)<br>
       <br>       <br>    def ShootBG(self, s, e):<br>        self.canvas.SetLeft(self.bgImage, self.canvas.GetLeft(self.bgImage) - 1)<br>        if self.canvas.GetLeft(self.bgImage) &lt; -2110:<br>            self.canvas.SetLeft(self.bgImage, 0)<br>
<br>    def KeyDown_Control(self, s, e):<br>        if e.Key == Key.Right:<br>            self.canvas.SetLeft(self.ship, self.canvas.GetLeft(self.ship) + velocity)<br>        elif e.Key == Key.Left:<br>            self.canvas.SetLeft(self.ship, self.canvas.GetLeft(self.ship) - velocity)<br>
        elif e.Key == Key.Up:<br>            self.canvas.SetTop(self.ship, self.canvas.GetTop(self.ship) - velocity)<br>        elif e.Key == Key.Down:<br>            self.canvas.SetTop(self.ship, self.canvas.GetTop(self.ship) + velocity)<br>
<br>gui = Gui()<br>gui<br><br>