How to trap for Enter key in ObjectPal?? 
Author Message
 How to trap for Enter key in ObjectPal??

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



Fri, 08 Oct 1999 03:00:00 GMT
 How to trap for Enter key in ObjectPal??

You would attach the code to the 'KeyPhysical' method, and test for
If eventinfo.vCharCode()=VK_Return then....

Bob



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



Sat, 09 Oct 1999 03:00:00 GMT
 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



Sat, 09 Oct 1999 03:00:00 GMT
 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 the KeyPhysical event:
        if eventinfo.charAnsiCode() = 13 then
                blah blah blah
        endif

You may or may not want to reset the eventcode to 0 by using
setcharvCode(0) as well

Regards,
Vaggs



Sun, 10 Oct 1999 03:00:00 GMT
 
 [ 4 post ] 

 Relevant Pages 

1. Trap the Enter Key

2. Trapping ENter KEY

3. trapping ENTER KEY

4. Trapping Enter Key

5. !!!! Enter Key -> Tab Key

6. How do I make the Enter key act like the Tab key

7. using enter key instead of tab key for data entry

8. Enter key instead of TAB key

9. Moving in fileds with Enter-key instead og Tab-key

10. Enter Key must work as Tab Key do

11. Make Enter key act as Tab key

12. Trapping for ENTER


 
Powered by phpBB® Forum Software