
How to trap for Enter key in ObjectPal??
Quote:
> I have a data entry form which I have jazzed up nicely with a variety
> of buttons and embedded code. Among other things I have it set up so
> that the depart method of certain fields does a moveto() to place the
> user on the next field for data entry. This has been a great help
> because users like being able to press the Enter key to go to the next
> field instead of having to use the mouse or a cursor control. Now the
> problem...
> On one of the fields, I would like to do something a little different
> and the depart method is causing problems. I need to just trap for
> the Enter key instead of trapping for a depart. In PAL this was easy.
> Can anyone tell me the syntax in ObjectPal for the following pseudo
> code which would be attached to a field in a form:
> if user presses the Enter key
> then do (here I'll stick in my code which works ok)
> endif
> Also.. what method does it get attached to? the action method?
> Please respond by email as well as posting... many thanks.
> John
in key event try with
if eventinfo.vcharcode()=VK_enter ... or something like that
but actually I didnt unserstand what you mean, if you press enter,at the opposite of
delphi, you get in the next field
marco