Trying to rename an object via keyboard input
Object names

Trying to rename objects is typically a sign, that you do not understand what you really want. 

Real world Example:

When you interact with a person you interact with the person not with the person's name. 

It is the same with objects, you interact with the object itself. 

Search Criteria

According to your description you have a single search criteria: the name. 

Where is this name coming from? Obvious when this is your criteria, you need to consider all objects matching that criteria. If you mean a certain object of the set of objects, you need to tell how you differentiate between them. Typically it is one or more other criteria.

Object References

When you already have a reference to the object you want to interact with, there is no need to look at it's name (unless you print it to console for debug reasons).

Analysis

I really do not understand what you are trying to achieve. Rephrasing the question might help. Here are my questions to you:


What objects are tracking?
What is each of that objects tracking?
When pressing Tab what should happen (I do not understand that sentence).
When clicking on an object, what should happen?


Solution

You need to implement a selection operation.