移動先: 概要 戻り値 フラグ. Python 例.
hotkey([altModifier=boolean], [autoSave=boolean], [commandModifier=boolean], [ctrlModifier=boolean], [factorySettings=boolean], [isModifier=boolean], [keyShortcut=string], [name=string], [pressCommandRepeat=boolean], [releaseCommandRepeat=boolean], [releaseName=string], [sourceUserHotkeys=boolean])
注意: オブジェクト名や引数を表す文字列はカンマで区切ります。これは概要には示されていません。
hotkey は 「元に戻す」が可能、「照会」が可能、「編集」が不可能 です。
このコマンドは、アプリケーション全体用の単一キーのホットキーを設定します。
なし
戻り値の型は照会モードでは照会フラグが基になります。
altModifier, autoSave, commandModifier, ctrlModifier, factorySettings, isModifier, keyShortcut, name, pressCommandRepeat, releaseCommandRepeat, releaseName, sourceUserHotkeys
: コマンドの作成モードで使用可能なフラグ
|
: コマンドの編集モードで使用可能なフラグ
|
: コマンドの照会モードで使用可能なフラグ
|
: タプルまたはリストとして渡された複数の引数を持てるフラグ
|
import maya.cmds as cmds
# Here's an example of how to create a namedCommand
# object and then map it to a key.
#
cmds.nameCommand( 'circleToolNamedCommand', annotation='Select Circle Tool', command='setToolTo circleContext')
cmds.hotkey( k='F5', alt=True, name='circleToolNamedCommand' )
# Here are more examples of how to use the hotkey command.
#
cmds.hotkey( k='d', name='Delete_Command' )
cmds.hotkey( k='d', name='' ) # unsets the above command
cmds.hotkey( k='d', name='Delete_Command' )
cmds.hotkey( k='d', releaseName='After_Delete_Command' )
cmds.hotkey( k='d', name='' ) #only unsets the key press name
cmds.hotkey( k='d', releaseName='' ) #only unsets the key release name
cmds.hotkey( k='d', n='', rn='' ) #unsets both the key press and release name
# Determine if a command is attached to either the press or release
# of the "z" hotkey.
#
cmds.hotkey( 'z', query=True )
# Likewise, for the modified variations of the "z" key.
#
cmds.hotkey( 'z', query=True, alt=True )
cmds.hotkey( 'z', query=True, ctl=True )
cmds.hotkey( 'z', query=True, alt=True, ctl=True )
# Determine the press command attached to the "z" key.
#
cmds.hotkey( 'z', query=True, name=True )
# To query the "-" hotkey use the string "Dash" instead.
#
cmds.hotkey( 'Dash', query=True )