[IronPython] Events on Buttons, and Focus, in IronPython

Ken MacDonald drken567 at gmail.com
Mon Feb 22 22:11:17 CET 2010


Aaaah. Managed mix up my args; seems to work OK now. Sorry.
Ken

On Mon, Feb 22, 2010 at 3:55 PM, Ken MacDonald <drken567 at gmail.com> wrote:

> Hi,
> I've inherited an I-P app, and trying to make some sense of it... It has a
> login page, with several text fields including "user" and "password"; and
> "Oed to K" and "CANCEL" buttons. Right now, you enter the user/password into
> the text fields, and then have to click the "OK" button to login. Customer
> would like this to work like most other apps, where filling in user/password
> and then typing the "Enter" key would also initiate the login. I've searched
> the I-P book and googled, but I can't find a workable reference to how to
> write a handler to determine the Enter key has been hit - actually, I was
> able to catch a keyboard event:
>
> pwd_fld.KeyDown += on_enter
>
> def on_enter(self, e, args)
>     # what here???
>
> but unable to determine what the keystroke is - "Iron Python In Action"
> suggests:
>
> if e.Key == Key.Enter:
>      # start login
>
> but I get the error "e has no attribute 'Key'"
>
> Clues appreciated....
> Ken
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20100222/08b8b490/attachment.html>


More information about the Ironpython-users mailing list