Description
| This lets you add or amend the behaviour of MUSHclient "accelerator" keys. For example, you could make Ctrl+E become "eat meat".
These changes only apply to the current world (the one the script function is run in). They override any existing macros or accelerator keys defined for MUSHclient's default behaviour.
You specify two arguments, the keystroke to add or amend, and the text to be sent. The text is sent to the MUSHclient command processor, and can thus contain aliases, speedwalks, script commands, or anything you might normally type into the command window.
For example, to execute a script simply prefix the script command with the scripting prefix. Or alternatively, make up a word you wouldn't normally type (like "SFDSHHG$%(&") and make an alias to match that. Then in the alias do whatever you want to do.
See also AcceleratorTo which lets you specify where to send the command (eg. script, speedwalk).
The keystroke consists of this syntax:
CTRL + ALT + SHIFT + key
The modifiers CTRL, ALT and SHIFT are all optional, and are not case-sensitive. They can appear in any order.
The key can be one of the following:
0 1 2 3 4 5 6 7 8 9
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Accept Add Apps Attn Backspace Cancel Capital Clear Control Convert Crsel Decimal Delete Divide Down End Enter Ereof Esc Execute Exsel F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 F13 F14 F15 F16 F17 F18 F19 F20 F21 F22 F23 F24 Final Hangeul Hangul Hanja Help Home Insert Junja Kana Kanji LButton LControl LMenu LShift LWin Left MButton Menu ModeChange Multiply NonConvert Noname Numlock Numpad0 Numpad1 Numpad2 Numpad3 Numpad4 Numpad5 Numpad6 Numpad7 Numpad8 Numpad9 Oem_clear Pa1 PageDown PageUp Pause Play Print ProcessKey RButton RControl RMenu RShift RWin Right Scroll Select Separator Snapshot Space Subtract Tab Up Zoom
They are not all guaranteed to work in the way you might expect. These names were obtained from the Windows include files. Some keys may be trapped by the operating system, or not be available on your PC.
Reasonable values to use would be things like:
Alt+Down
Shift+Ctrl+F2
Ctrl+N
PageUp
Ctrl+PageUp
F5
Ctrl+Shift+F9
--------
To disable a previously-assigned accelerator, call this function with an empty string as the command. eg
Accelerator "Ctrl+K", "" ' return to default behaviour
If you wanted to make a key simply "do nothing" then you will need to do something like send an empty script, or make a "do nothing" alias, and call that. eg.
Accelerator "Ctrl+K", "/" ' execute empty script
Accelerator "Ctrl+K", "DO_NOTHING_ALIAS" ' call an alias that does nothing
The "do nothing" alias might be the safer approach, in case someone has changed the scripting prefix to something other than "/".
----------
To see the name for a particular keypress use the Input menu -> Key Name dialog. This lets you type a key and have its name displayed. This name can then be used in this function.
Note: Available in version 3.53 onwards.
|