Update in progress...
Version 2 is stable.
Inspired by the question, "Markdown syntax for <kbd>foo</kbd>
", this script adds both a button and a keyboard shortcut to each post's <textarea>
(when editing posts).
Press the button or press AltK on the keyboard and <kbd></kbd>
will be inserted at the cursor.
If text is selected, it will be wrapped by the <kbd>
tags instead.
Tested the script on both Firefox (needs the Greasemonkey add-on) and Chrome (might work for Opera too).
To install, click here (Add_kbd_shortcut.user.js install at Github).
To preview the source, click here (Add_kbd_shortcut.user.js preview at Github).
Known limitations, possible future enhancements:
This shortcut handles leading and trailing whitespace the same way that other SE shortcuts (Bold, Italic, Code) do.
This shortcut now wraps and unwraps the same way that other SE shortcuts (Bold, Italic, Code) do.