# Input field cursor removal and keylistening

**URL:** <https://forum.kirupa.com/t/input-field-cursor-removal-and-keylistening/331291>\
**Category:** flash\
**Created:** [June 30, 2013, 10:21am UTC](https://forum.kirupa.com/t/input-field-cursor-removal-and-keylistening/331291 "2013-06-30T10:21:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gnur](https://avatars.discourse-cdn.com/v4/letter/g/e19adc/32.png) [@Gnur](https://forum.kirupa.com/u/Gnur)\
**Post date:** [June 30, 2013, 10:21am UTC](https://forum.kirupa.com/t/input-field-cursor-removal-and-keylistening/331291/1 "2013-06-30T10:21:00Z")

</div>

Hey.

I have a textfield waiting for input, to bind a keyboard key to a function.

Right now I have:

```auto

[LEFT]inputBox.[COLOR=#993300]text[/COLOR]=[COLOR=#0000FF]"Click here to set key..."[/COLOR];
 inputBox.[COLOR=#993300]onSetFocus[/COLOR] = [COLOR=#993300]function[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{
[/COLOR] inputBox.[COLOR=#993300]text[/COLOR] = [COLOR=#0000FF]"Awaiting input..."[/COLOR]; 
[COLOR=#000000]}[/COLOR]
[/LEFT]

```

I want the selector cursor (the one in front of my letters as I type this post) to disappear while it’s “Awaiting input…”.  
Also I want to set up a keylistener that listens for a keypress only if the textfield is in focus, and displays the key that was pressed in the textfield, (capitalized) and thereafter removes focus from the textfield.  
I know many of the commands, but can’t make them work.

Any ideas on how to write this?
