User talk:GregU/hotkeys.js

From OpenWetWare
Jump to: navigation, search

This user script allows you to use "hotkeys" to enter certain hard-to-type characters or commonly used phrases in text boxes. It was originally written to allow easily entering the right-arrow (→) into the edit summary field, as this character is especially useful in edit summaries and is hard to enter. Now simply typing Ctrl-> produces the arrow. Later, the script was updated to allow using the same hotkeys in the main edit field.

To install this script, just add  importScript("User:GregU/hotkeys.js");  to your monobook.js page. This will enable the default hotkeys defined in the script. To add your own hotkey definitions or override the defaults, add this to your monobook.js: <source lang="javascript"> hotkeys = {

   'b' : 'Brooks was here',
   'l' : ,
   's' : '§',
   't' : '{| class="wikitable"\n! header\n! header\n|-\n| data\n| data\n|}\n'

}; </source>

This sets Ctrl+B to enter "Brooks was here", the default Ctrl+L hotkey is disabled (reverting back to the default Firefox behavior), Ctrl+S enters the section symbol, and Ctrl+T enters a table skeleton.

See also