How can I turn off Bluetooth with only keyboard actions?

Solution 1:

Go into the Finder, type command + shift + u and open Script Editor by selecting it and typing command + o. In a new script, type (since you can't highlight to copy)

tell application "System Events"
    click button "Turn Bluetooth Off" of window 1 of application process "System Preferences"
end tell

and then type command + r to run the script. The trackpad should now be disconnected.

Solution 2:

If you have a TouchBar Mac Book: Invoke Siri via TouchBar and simply say "Turn Off Bluetooth"

If Siri is not enabled, it will prompt you to enable first.

https://support.apple.com/en-us/HT206993

First time used Siri on my Mac!