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.

2 Likes

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
4 Likes

Any update on this? I was trying to put to use focus() on a link but the function doesn’t seem to exist. Or am I missing something?

linked topic

1 Like