Jump to content

Toggle Fn keys as standard keys


Recommended Posts

  • 4 years later...
  • 5 weeks later...

You can use custom script like:

 

state=$(defaults read "Apple Global Domain" "com.apple.keyboard.fnState")

if ((state)); then
  echo "true"
  defaults write "Apple Global Domain" "com.apple.keyboard.fnState" "0" ## Brightness/Media
else
  echo "false"
  defaults write "Apple Global Domain" "com.apple.keyboard.fnState" "1" ## F1 F2 etc
fi

defaults read "Apple Global Domain" "com.apple.keyboard.fnState"

 

Link to post
  • 3 weeks later...
  • 3 weeks later...

This is still a work in progress but I think it should work with os Catalina and Big Sur

on alfred_script(q)
set theCheckboxBoolean to false
set checkboxcompare to "Use F1, F2, etc."
set i to 0

tell application "System Preferences"
	reveal anchor "keyboardTab" of pane "com.apple.preference.keyboard"
end tell
tell application "System Events"
	tell process "System Preferences"
		tell window "Keyboard"
			set listCheckboxes to (entire contents as list)
			repeat with thisItem in listCheckboxes
				if class of thisItem is checkbox then
					set checkboxtitle to title of thisItem as text
					if checkboxtitle contains checkboxcompare then
						set theCheckbox to thisItem
						tell theCheckbox
							click theCheckbox
							log (its value as boolean)
							set theCheckboxBoolean to (its value as boolean)
						end tell
						exit repeat
					end if
				end if
				set i to i + 1
				delay 0.04
			end repeat
		end tell
	end tell
end tell

quit application "System Preferences"
return theCheckboxBoolean
end alfred_script

 

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...