Hello,
I would like to submit a new minor macro for integration within Org: the
"kbd" macro.
The "kbd" macro focuses on normalizing keybinding during export. For
example, during Texinfo export, {{{kbd(v SPC)}}} becomes
@kbd{v @key{SPC}}
whereas in another back-end, it becomes
v <SPC>
More specifically:
Within {{{kbd(...)}}}, the following case-sensitive keys are wrapped
within angle brackets: SPC, RET, LFD, TAB, BS, ESC, DELETE, SHIFT,
CTRL, META, up, down, left, right.
With an optional argument, it can wrap the key-binding within verbatim
or code markup:
{{{kbd(v SPC,code)}}} => ~v <SPC>~
{{{kbd(v SPC,verbatim)}}} => =v <SPC>=
Granted, this is probably only useful for Texinfo export, but defining
it as a global macro makes Org documents a bit more portable across
export back-ends.
If there is any interest in it, I will add tests and documentation.
I attach a proof of concept.
Kaushal Modi