pymel.core.context.hotkeyCtx

hotkeyCtx(*args, **kwargs)

This command sets the hotkey context for the entire application. In query mode, return type is based on queried flag.

Flags:

Long Name / Short Name Argument Types Properties
addClient / ac unicode ../../../_images/create.gif
  Associates a client to the given hotkey context type. This flag needs to be used with the flag typewhich specifies the context type.
clientArray / ca bool ../../../_images/query.gif
  Returns an array of the all context clients associated to the hotkey context type. This flag needs to be used with the flag typewhich specifies the context type.
currentClient / cc unicode ../../../_images/create.gif ../../../_images/query.gif
  Current client for the given hotkey context type. This flag needs to be used with the flag typewhich specifies the context type.
insertTypeAt / ita unicode, unicode ../../../_images/create.gif
  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 Globalcontext type. The second argument specifies the name of new context type.
removeAllClients / rac bool ../../../_images/create.gif
  Removes all the clients associated to the hotkey context type. This flag needs to be used with the flag typewhich specifies the context type.
removeClient / rc unicode ../../../_images/create.gif
  Removes a client associated to the hotkey context type. This flag needs to be used with the flag typewhich specifies the context type.
removeType / rt unicode ../../../_images/create.gif
  Removes the given hotkey context type.
type / t unicode ../../../_images/create.gif ../../../_images/query.gif
  Specifies the context type. It’s used together with the other flags such as currentClient, addClient, removeClientand so on.
typeArray / ta bool ../../../_images/query.gif
  Returns a string array containing the names of all hotkey context types, ordered by priority.
typeExists / te unicode ../../../_images/query.gif
  Returns true|false depending upon whether the specified hotkey context type exists. Flag can have multiple arguments, passed either as a tuple or a list.

Derived from mel command maya.cmds.hotkeyCtx

Example:

::

import pymel.core as pm

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

# Create a new context type pm.hotkeyCtx( insertTypeAt=(‘Global’, ‘CustomEditor’) ) pm.hotkeyCtx( ita=(‘CustomEditor’, ‘CustomTool’) )

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

# Remove an existing context type pm.hotkeyCtx( removeType=’CustomTool’ )

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

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

# Set current context pm.hotkeyCtx( t=’CustomEditor’, cc=’hyperGraphPanel’ )

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

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

# Remove all associated clients pm.hotkeyCtx( t=’CustomEditor’, rac=True )