Page 1 of 1

PostPosted: Tue Dec 04, 2001 6:56 am
by maurub
Hi there:
Here I go again to ask for some help. Writing a program in which the user needs to make some inputs, I want you to tell me please, how can I send the content of a edit box to a variable by pressing the ENTER KEY of the keyboard? This variable could be int and string type. I made a routine that could do it by creating a button named OK, but I thought that if I have a keyboard that I use to input some values, It would be useful to use the ENTER KEY instead of that OK BUTTON.
The second question is how can I use the TAB key to navegate in a page in which I have several EDIT controls? Thanks in advance.

PostPosted: Tue Dec 04, 2001 8:20 am
by guy
If this for CE. Check for PM_CHAR messages and look at the value returned by the key() function. Return/enter is 13, tab is 9.

If your edit box is not multiline then the machine will beep when you press enter, but you'll still get the key.

You need to check guigetfocus() to find out which control the key was typed into, not guiid() as for other events.

To use tab to navigate through controls, use guisetfocus() to change the current control each time you get a tab key pressed.

PocketC CE API interface:

Edited by - guy on 12/04/2001 02:21:44