The purpose of this document is to outline the specifications of shortcuts.txt -- a plain-text file used by web applications that indicates what keyboard shortcuts are provided to the user.
In order to support shortcuts.txt, a web application should provide a plain text file located at the root of its application.
Example:
https://pizzamaker3000.com/shortcuts.txt
Each shortcuts.txt should be written in TOML (Tom's Obvious Minimal Language). This makes it both easily readable by humans as well as parsable by other applications.
# Twitter shortcuts
# Sourced from https://twitter.com/i/keyboard_shortcuts
[[navigation]]
title = "Shortcut help"
shortcut = "?"
[[navigation]]
title = "Next Tweet"
shortcut = "j"
[[navigation]]
title = "Previous Tweet"
shortcut = "k"
[[actions]]
title = "New Tweet"
shortcut = "n"
[[actions]]
title = "Send Tweet"
shortcut = "⌘ + Enter"
Expected JSON:
{
"navigation": [
{
"title": "Shortcut help",
"shortcut": "?"
},
{
"title": "Next Tweet",
"shortcut": "j"
},
{
"title": "Previous Tweet",
"shortcut": "k"
}
],
"actions": [
{
"title": "New Tweet",
"shortcut": "n"
},
{
"title": "Send Tweet",
"shortcut": "⌘ + Enter"
}
]
}