keys

Discuss topics that apply across the products, such as the PocketC language, or development in general

Postby maurub on Tue Dec 04, 2001 6:56 am

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.
maurub
 
Posts: 17
Joined: Thu May 31, 2001 5:44 pm
Location: Mexico

Postby guy on Tue Dec 04, 2001 8:20 am

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.


Guy
[url]mailto:pcform@pcform.net[/url]
http://www.pcform.net
PocketC CE API interface: http://www.networkdynamics.net/pcktceapi.zip



Edited by - guy on 12/04/2001 02:21:44
Guy
[url]mailto:pcform@pcform.net[/url]
http://www.pcform.net
PocketC CE API interface: http://www.networkdynamics.net/PCForm.html#library
PCForm and CE API forum: http://www.networkdynamics.net/forum
guy
 
Posts: 879
Joined: Thu Dec 07, 2000 8:58 am
Location: United Kingdom


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests

cron