Anvil Community Forum

Making forms more keyboard friendly

Two simple things would make the use of forms without mouse easier and more consistent with most desktop applications.

  1. When a form opens the first component (that can have the focus) should get the focus. I always do it with one line of code, but Anvil should do it automatically.

  2. Add the button default and cancel properties to the button (as in vb6) or the accept_button and cancel_button (as in .net) so the form can be submitted or cancelled by pressing enter or esc, without using the mouse.

1 Like

Also:

  • Add focus() to Link and Button (and anything else that can accept the focus)
  • Add my_form.get_control_with_focus() (or my_form.active_control)
  • Add keydown event
3 Likes