Go to: Synopsis. Return value. Related. Flags. Python examples.

Synopsis

hotkeyCtx([addClient=string], [clientArray=boolean], [currentClient=string], [insertTypeAt=[string, string]], [removeAllClients=boolean], [removeClient=string], [removeType=string], [type=string], [typeArray=boolean], [typeExists=string])

Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.

hotkeyCtx is undoable, queryable, and NOT editable.

This command sets the hotkey context for the entire application.

Return value

None

In query mode, return type is based on queried flag.

Related

hotkey, hotkeySet

Flags

addClient, clientArray, currentClient, insertTypeAt, removeAllClients, removeClient, removeType, type, typeArray, typeExists
Long name (short name) Argument types Properties
addClient(ac) string createmultiuse
Associates a client to the given hotkey context type. This flag needs to be used with the flag "type" which specifies the context type.
clientArray(ca) boolean query
Returns an array of the all context clients associated to the hotkey context type. This flag needs to be used with the flag "type" which specifies the context type.
currentClient(cc) string createquery
Current client for the given hotkey context type. This flag needs to be used with the flag "type" which specifies the context type.
insertTypeAt(ita) [string, string] create
Inserts a new hotkey context type in the front of the given type. The first argument specifies an existing type. If it's empty, the new context type will be inserted before "Global" context type. The second argument specifies the name of new context type.
removeAllClients(rac) boolean create
Removes all the clients associated to the hotkey context type. This flag needs to be used with the flag "type" which specifies the context type.
removeClient(rc) string createmultiuse
Removes a client associated to the hotkey context type. This flag needs to be used with the flag "type" which specifies the context type.
removeType(rt) string create
Removes the given hotkey context type.
type(t) string createquery
Specifies the context type. It's used together with the other flags such as "currentClient", "addClient", "removeClient" and so on.
typeArray(ta) boolean query
Returns a string array containing the names of all hotkey context types, ordered by priority.
typeExists(te) string query
Returns true|false depending upon whether the specified hotkey context type exists.

In query mode, this flag needs a value.


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 have multiple arguments, passed either as a tuple or a list.

Python examples

import maya.cmds as cmds

# Here are some examples of how to use hotkeyCtx command.
#

# Create a new context type
cmds.hotkeyCtx( insertTypeAt=('Global', 'CustomEditor') )
cmds.hotkeyCtx( ita=('CustomEditor', 'CustomTool') )

# Query all existing context types
ctxTypes = cmds.hotkeyCtx( typeArray=True, query=True )
print str(ctxTypes)

# Remove an existing context type
cmds.hotkeyCtx( removeType='CustomTool' )

# Determine if the given context type exists.
cmds.hotkeyCtx( te='CustomTool', query=True )

# Associate the clients to the specific context type.
cmds.hotkeyCtx( t='CustomEditor', ac=['hyperGraphPanel', 'outlinerPanel'] )

# Set current context
cmds.hotkeyCtx( t='CustomEditor', cc='hyperGraphPanel' )

# Unassign the client from the specific context type.
cmds.hotkeyCtx( t='CustomEditor', rc='outlinerPanel' )

# Query all associated clients for the given context type.
cl = cmds.hotkeyCtx( t='CustomEditor', ca=True, query=True )
print str(cl)

# Remove all associated clients
cmds.hotkeyCtx( t='CustomEditor', rac=True )