How can I turn off Bluetooth with only keyboard actions?
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.