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

Synopsis

mouse([enableScrollWheel=boolean], [mouseButtonTracking=int], [mouseButtonTrackingStatus=boolean], [scrollWheelStatus=boolean])

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

mouse is undoable, NOT queryable, and NOT editable.

This command allows to configure mouse.

Return value

intWhen -scrollWheelStatus flag is used, will return 1 if scroll wheel support enabled, otherwise 0.
When -mouseButtonTrackingStatus flag is used, will return the number of mouse buttons being tracked.

Flags

enableScrollWheel, mouseButtonTracking, mouseButtonTrackingStatus, scrollWheelStatus
Long name (short name) Argument types Properties
enableScrollWheel(esw) boolean create
Enable or disable scroll wheel support.
scrollWheelStatus(sws) boolean create
returns the current status of scroll wheel support.
mouseButtonTracking(mbt) int create
Set the number (1, 2 or 3) of mouse buttons to track.
Note: this is only supported on Macintosh
mouseButtonTrackingStatus(mbs) boolean create
returns the current number of mouse buttons being tracked.

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

cmds.mouse( enableScrollWheel=False )

mouseEnabled = cmds.mouse(scrollWheelStatus=True)

cmds.mouse( mouseButtonTracking=1 )

numberOfMouseButtons = cmds.mouse(mouseButtonTrackingStatus=True)