Source language: Translate to:

How do I find which object is focused and its name?

General questions about NeoBook

Moderator: Neosoft Support

How do I find which object is focused and its name?

Postby Enigman » Wed Sep 03, 2014 9:31 am

I am creating a virtual keyboard for a data program. The screen has multiple text entry boxes. I want to be able to open the keyboard panel and programmatically determine which text box has the focus, then obtain its object name and determine the content of the text object. I need to know its object name so I can determine which keyboard presses are valid for that text object. For example, I will disallow tabs and returns from single line text objects. I also need to know the text content so I can find the cursor and insert the key press.

I don't see native NB commands for doing this. Does anyone know a way to get at least the focused object name. If I have that I can use a lookup table to get the variable name, but it would be great if I could also determine the variable name on the fly.

Thanks.
User avatar
Enigman
 
Posts: 314
Joined: Tue Apr 12, 2005 3:57 pm
Location: Foothill Ranch, CA

Re: How do I find which object is focused and its name?

Postby dpayer » Wed Sep 03, 2014 9:37 am

Enigman wrote:I don't see native NB commands for doing this. Does anyone know a way to get at least the focused object name. If I have that I can use a lookup table to get the variable name, but it would be great if I could also determine the variable name on the fly.

Thanks.


Helpfile is your friend. I did a search for focus and it directed me to the page for "Predefined Global Variables"

[FocusedObject]
The name of the object that has the input focus.
David Payer
Des Moines, Iowa
USA
User avatar
dpayer
 
Posts: 1383
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Re: How do I find which object is focused and its name?

Postby Enigman » Wed Sep 03, 2014 9:44 am

[FocusedObject]
The name of the object that has the input focus.

Knarly, ... I didn't even think of a variable for it. I assumed it would have to be an object command.

Thanks so much.
User avatar
Enigman
 
Posts: 314
Joined: Tue Apr 12, 2005 3:57 pm
Location: Foothill Ranch, CA


Return to General NeoBook Discussions

Who is online

Users browsing this forum: Bing [Bot] and 2 guests