Sending focus and default buttons in callout

I’ve been looking for this question and I have not found it in the forum, and I don’t know how to solve it.

I’ve got a callout with 2 text fields (lets name then txt_1 and txt_2) and 2 buttons (lets name btn_1 and btn_2) and I need:

  • When the callout is open the field txt_1 has to get the focus, so the user can start writing.
  • When the user presses “enter” key the btn_1 should be clicked.
  • When the user presses “esc” key the btn_2 should be clicked

My idea is that the user can control the callout without the mouse, just with the keyboard. They need speed in the data entry but the callouts are slowing them, so they are complaining.

Thanks in advance!.