FN Modifier Key Switcher for Mac

all about tech.
Post Reply
george
Site Admin
Posts: 13
Joined: Thu Aug 01, 2019 3:16 am
FN Modifier Key Switcher for Mac

Post by george » Thu May 21, 2020 10:02 am

FNSwitch, an application designed to easily switch between FN (F1-F12 keys) and the icons apple includes on them instead. This is useful if you play games that require the use of the F1-F12 keys, no one wants to have to press FN and the F1-F12 key when they could just press the key itself. When you’re done gaming, however, it’s nice to be able to adjust the volume and brightness without having to press FN. This is where FNSwitch comes in to play, it can help make the task of switching between modes a little easier.

Use F1, F2, etc. keys as standard function keys
when this option is selected, press the Fn key to use the special features printed on each key.

Download Now
Visit Github Repo

If you don't want to download the precompiled application above, we've also included the pure applescript code which can be copied below.
note: there is no benefit to copying the applescript, it's much easier to download from "Download Now"

Code: Select all

tell application "System Preferences"
	activate
	set current pane to pane id "com.apple.preference.keyboard"
end tell
delay 1
activate
tell application "System Events" to get name of every process
if the result contains "System Preferences" then
	tell application "System Events" to tell process "System Preferences"
		set theCheckbox to checkbox 1 of tab group 1 of window 1
		set checkboxStatus to value of theCheckbox as boolean
	end tell
	if checkboxStatus is true then set onOffMsg to "On"
	if checkboxStatus is false then set onOffMsg to "Off"
	display dialog onOffMsg & ": Use F1, F2, etc. keys as standard function keys." buttons {"Quit", "Toggle"} default button 2
	if the button returned of the result is "Toggle" then
		tell application "System Preferences"
			reveal anchor "keyboardTab" of pane "com.apple.preference.keyboard"
		end tell
		tell application "System Events" to tell process "System Preferences"
			if checkboxStatus is true then display dialog "Standard functon keys enabled" buttons {"OK"} default button 1
			if checkboxStatus is false then display dialog "FN keys enabled" buttons {"OK"} default button 1
			click theCheckbox
		end tell
		quit application "System Preferences"
	else if the button returned of the result is "Quit" then
		display dialog "Thanks for using our software, please consider supporting our developers." buttons {"Support the devs", "No Thanks"} default button 1
		if the button returned of the result is "Support the devs" then
			tell application "Safari"
				open location "http://www.techmasterdesign.com"
				activate
			end tell
		end if
	else
		display dialog "System preferences must be open and switched to the keyboard tab"
	end if
end if

simply open applescript editor and paste the above code in the editor, then save it as an applicaton called "FNSwitch," you won't have the fancy icon, but you'll have the script. Please note, FNSwitch Legacy is for older or slower computers that take longer to open System Preferences, this application adds a needed delay so that the script waits properly for System preferences to fully open before it pulls any information. You can Delete FNSwitch Legacy but test both apps and see which one works for you.
Attachments
FNIcon.png
FNIcon.png (6.78 KiB) Viewed 3990 times


Post Reply