Go to: Synopsis. Return value. Flags. MEL examples.

Synopsis

overrideModifier [-clear] [-press string] [-release string]

overrideModifier is undoable, NOT queryable, and NOT editable.

This command allows you to assign modifier key behaviour to other parts of the system. For example you can use a hotkey or input device instead of a modifer key to perform the same action.

Note that the original modifier key behaviour is not altered in anyway. For example, if you've assigned "Ctrl" key behaviour to the "c" key then the "Ctrl" key will still work as you expect, all you've done is allowed yourself to use the "c" key as an alternative to the "Ctrl" key.

Return value

None

Flags

clear, press, release
Long name (short name) Argument types Properties
-press(-p) string createmultiuse
Force the following modifier to be pressed. Valid values are "Alt", "Ctrl", "Shift".
-release(-r) string createmultiuse
Force the following modifier to be released. Valid values are "Alt", "Ctrl", "Shift".
-clear(-cl) create
Don't force any modifier keys.

Flag can appear in Create mode of command Flag can appear in Edit mode of command
Flag can appear in Query mode of command Flag can be used more than once in a command.

MEL examples

//    Example 1.
//
//    Map the "a" key such that it behaves just like the "Alt" key.
//
nameCommand
    -annotation "Alternate Alt-press modifier key"
    -command "overrideModifier -press Alt"
    alternateAltPressCommand;
nameCommand
    -annotation "Alternate Alt-release modifier key"
    -command "overrideModifier -release Alt"
    alternateAltReleaseCommand;
hotkey -keyShortcut "a" -name "alternateAltPressCommand";
hotkey -keyShortcut "a" -releaseName "alternateAltPressCommand";

//    Example 2.
//
//    The following should restore the "a" hotkey to what it was
//    previously.
//
overrideModifier -clear;
hotkey -factorySettings;
hotkey -sourceUserHotkeys;