Problem with Custom Input Manager

I’ves managed to do pretty much everything.
The only problem i am having is with the interface code.

I want to the player click on an object, that represents an key, and then press the new key they want to asign. But with the code i have right now when i click the object the code return the click as the key i want to assign. What should i do to correct it?

Here is the code: http://nopaste.info/e4aeb9882e.html

Thanks in advance

You need to check that Event.current.type is a key down event.