6

Full Keyboard Access mode is enabled or disabled in the Keyboard preference pane - it's referenced here:

Efficiently subclassing standard Cocoa controls

and here:

Disable Full Keyboard Access for App

but nowhere on the web have I found out how to determine, within my app, if Full Keyboard Access is enabled. I'm writing a custom radio control and want to allow tabbing into it iff Full Keyboard Access is on.

Community
  • 1
  • 1
Mira
  • 161
  • 7

2 Answers2

10

In Mac OS X 10.6 or higher: -[NSApp isFullKeyboardAccessEnabled].

danielpunkass
  • 17,527
  • 4
  • 24
  • 38
5

As best I know this is undocumented. It is stored in AppleKeyboardUIMode in NSGlobalDomain:

defaults read -g AppleKeyboardUIMode

It's a bitfield, but I've never seen docs for it. "Full Keyboard Access" seems to toggle bit 1 (value=2).

The short is you should be able to fetch this from NSUserDefaults and bitmask it to find your answer, but it could change.

Rob Napier
  • 286,113
  • 34
  • 456
  • 610