<!-- thumbnail: https://i.sstatic.net/25p0m.png -->
<!-- version: 2.0 -->
<!-- tag: editing -->
<!-- excerpt: Makes using the &lt;kbd&gt;, &lt;sup&gt;, and &lt;sub&gt; tags a snap! This is a cross-browser userscript that adds buttons and keyboard shortcuts that operate in the same manner as the other SE, editing buttons. -->
<!-- website: https://github.com/BrockA/SE-misc -->

**Update in progress...**  
Version 2 is stable.

Inspired by the question, ["Markdown syntax for `<kbd>foo</kbd>`"][1], this script **adds both a button and a keyboard shortcut** to each post's `<textarea>` (when editing posts).

Press the button or press <kbd>Alt</kbd><kbd>K</kbd> 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).

Screenshot:  
[![This script in action][2]][3]

----------
**To install**, click [here (Add_kbd_shortcut.user.js install at Github)][5].

**To preview the source**, click [here (Add_kbd_shortcut.user.js preview at Github)][6].


----------
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.
 

  [1]: http://meta.stackoverflow.com/q/130074/148310
  [2]: https://i.sstatic.net/NlJqP.gif "Click for larger image."
  [3]: https://i.sstatic.net/NlJqP.gif "Click for larger image."
  [5]: https://github.com/BrockA/SE-misc/raw/master/Add_kbd_sup_sub_shortcuts.user.js
  [6]: https://github.com/BrockA/SE-misc/blob/master/Add_kbd_sup_sub_shortcuts.user.js
  [7]: http://stackapps.com/a/3346/7653