Aahz wrote:
In article <wxorl.328387$yx2.227...@en-nntp-06.dc1.easynews.com>,
Jive Dadson  <notonthe...@noisp.com> wrote:
Gosh, you guys are slow. :-) I figured it out.

Perhaps you could post the solution for posterity's sake?

The double secret magic encantation is "WarpPointer." Unfortunately, it does not work in a plain vanilla ScrolledWindow. ScrolledWindow captures the event and scrolls by the default scroll amount of 20 pixels. I think I can figure out a work-around, but I have not yet done so.

self.bmp.Bind(wx.EVT_KEY_DOWN, self.OnKeyDown)

def OnKeyDown(self, event):
        # Use direction keys to move cursor one pixel

        x,y = event.GetPosition()
        keycode = event.GetKeyCode()
        X = 0
        Y = 0
        if keycode == wx.WXK_LEFT:
            X = -1
        elif keycode == wx.WXK_RIGHT:
            X = 1
        elif keycode == wx.WXK_UP:
            Y = -1
        elif keycode == wx.WXK_DOWN:
            Y = 1
        else:
            return

        x = max(0,min(self.size[0]-1,x+X))
        y = max(0,min(self.size[1]-1,y+Y))
        self.bmp.WarpPointer(x, y)
        self.bmp.SetFocus()
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to