# Java.awt.event for Enter Key

**URL:** <https://forum.inductiveautomation.com/t/java-awt-event-for-enter-key/4889>\
**Category:** Ignition\
**Created:** [July 26, 2012, 3:58pm UTC](https://forum.inductiveautomation.com/t/java-awt-event-for-enter-key/4889 "2012-07-26T15:58:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jkrugerud](https://avatars.discourse-cdn.com/v4/letter/j/22d042/32.png) [@jkrugerud](https://forum.inductiveautomation.com/u/jkrugerud)\
**Post date:** [July 26, 2012, 3:58pm UTC](https://forum.inductiveautomation.com/t/java-awt-event-for-enter-key/4889/1 "2012-07-26T15:58:55Z")

</div>

I would like to use the enter key after I have keyed in a value in the numeric text field to run a script when I press the enter key. Is there a simple way to do this other than writing a script module to define a Robot and KeyEvent from java.awt?

---

<div class="post-metadata">

**Author:** ![James.Lorenz](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/james.lorenz/32/3290_2.png) [@James.Lorenz](https://forum.inductiveautomation.com/u/James.Lorenz)\
**Post date:** [July 26, 2012, 4:07pm UTC](https://forum.inductiveautomation.com/t/java-awt-event-for-enter-key/4889/2 "2012-07-26T16:07:48Z")

</div>

You can put the following on a keyPressed event:

`if event.keyCode == event.VK_ENTER:
	#do something`

For more information about keyboard events:

[inductiveautomation.com/support/ … \_types.htm](http://inductiveautomation.com/support/usermanuals/ignition/event_types.htm) (under “key events” header)

---

<div class="post-metadata">

**Author:** ![jkrugerud](https://avatars.discourse-cdn.com/v4/letter/j/22d042/32.png) [@jkrugerud](https://forum.inductiveautomation.com/u/jkrugerud)\
**Post date:** [July 26, 2012, 4:09pm UTC](https://forum.inductiveautomation.com/t/java-awt-event-for-enter-key/4889/3 "2012-07-26T16:09:28Z")

</div>

Great, thank you
