# Tab when Enter Key Pressed

**URL:** <https://forum.inductiveautomation.com/t/tab-when-enter-key-pressed/37606>\
**Category:** Ignition\
**Created:** [August 11, 2020, 2:26pm UTC](https://forum.inductiveautomation.com/t/tab-when-enter-key-pressed/37606 "2020-08-11T14:26:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tbalcom](https://avatars.discourse-cdn.com/v4/letter/t/ee7513/32.png) [@tbalcom](https://forum.inductiveautomation.com/u/tbalcom)\
**Post date:** [August 11, 2020, 2:26pm UTC](https://forum.inductiveautomation.com/t/tab-when-enter-key-pressed/37606/1 "2020-08-11T14:26:22Z")

</div>

I have a template repeater with several labels and a single editable text field. When the user presses the tab key, focus moves to the next record in the template repeater as it should. I am trying to replicate this when the user presses the enter key. I can catch the enter key with

if event.keyCode==VK\_ENTER:  
#Do something

I can also add code to set focus to a specific field using the Component.requestFocus(). But what if the component is the same field, just in the next record of the template repeater.

Is there a way to reference the component on the next record?  
Is there a way to just send a tab key when the users presses enter?  
other ideas???

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [August 11, 2020, 3:28pm UTC](https://forum.inductiveautomation.com/t/tab-when-enter-key-pressed/37606/2 "2020-08-11T15:28:02Z")

</div>

[https://docs.oracle.com/javase/tutorial/uiswing/misc/focus.html#addreturn](https://docs.oracle.com/javase/tutorial/uiswing/misc/focus.html#addreturn)  
You can programatically add Enter to the set of focus traversal keys - you’ll have to translate the sample code from Java to Jython, and I’ll add a disclaimer that I have no idea what that might do to key handling on any other components, but it’ll probably be fine.
