Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Keystroke Fn (function) key in Applescript

Is there any way to keystroke the Fn key in apple script? Ideally I would like to be able to "press it" twice in order to launch voice typing.

Thanks in advance!

like image 329
user2555399 Avatar asked Aug 08 '26 18:08

user2555399


1 Answers

delay 0.5 -- time to release modifier keys if the script is run with a keyboard shortcut
tell application "System Events"
    key code 63 -- fn
    key code 63
end tell

See Events.h or my website for the key codes.

like image 114
Lri Avatar answered Aug 10 '26 11:08

Lri



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!