help me understand tabs

I would expect that if I have an text field and a few buttons, that after I type into the text box and hit TAB, that each button would lite up so I could hit enter but my app does not do that. Do I have to code that. If so , how. Thanks.

by TAB, I guess you mean the TAB key…
Normally this key moves the focus from the current control to the next control in the tab sequence (see the TABSTOP and TABINDEX property of each control). You can tell each control to ignore its position in the sequence (ie. it won’t stop there)

TABINDEX defines the order in which controls will appear in the sequnce
TABSTOP defines if the control will accept or ignore its position

thanks Dave, TABINDEX and TABSTOP are setup, but its not working. TAB does not move the focus from button to button.

What OS are you talking about? OS X does not have this behavior by default. You have to turn on Full Keyboard Access in the Keyboard System Preferences.

This works in all my OSX apps… where is this Keyboard System Preferences option you speak of?

All I see is

  • Key Repeat
  • Delay
  • use F1, F2 as standard
  • Show view in menubar

ok … its under SHORTCUTS

but the choices are TEXTBOXES and LIST ONLY -or-EVERYTHING
you can’t turn if OFF … just limit it

and I have it set to Textboxes and it all works fine

10.10.5 Yosemite. I do not see the Full Keyboard access anywhere. Hitting TAB does not send the focus with the blue box around it to jump to the next button.

Right, it’s in Keyboard and then Shortcuts. I can only tab into buttons if I have “All Controls” selected (on 10.10.5).

Employee of the month for Lefebvre, way to go Paul.

I added keydown on the button, so now ANY key you hit brings up my msgbox. How about just ENTER, not TAB, not ARROW KEY…JUST THE ENTER KEY.

If you only want an action to occur for a specific key, then do a test on the Key parameter of the KeyDown event handler.

If Key = Chr(13) Then MsgBox("Hi") Return True End If

If you want both [RETURN] and [ENTER] to act the same

If Key = Chr(13)  Or Key=Chr(3) Then
  Return True
End If

you guys are so awesome. I am an audio post production engineer. I live in folders all day long. Looking for a project folder on some server. I wrote an applescript that finds the folder I am looking for. Now, I can tab around my interface and hit enter when the button has the focus and the button down key triggers my code. Thank you both so very much. Less clicking, more productivity.