Class ShortcutCallback

3DS Max Plug-In SDK

Class ShortcutCallback

See Also: Class ShortcutOperation, Class ShortcutTable, Class Interface.

class ShortcutCallback

Description:

This class is available in release 3.0 and later only.

An instance of a class derived from this class is passed into the method Interface:: ActivateShortcutTable().

When the user presses a shortcut key that is assigned in an active table, the system calls the KeyboardShortcut(int id) method of this class with the id of the operation.

KeyboardShortcut() should normally return TRUE. If the KeyboardShortcut() call returns FALSE, the system will ignore that shortcut and process any system shortcut for the key. This lets the plug-in selectively override system defined shortcuts. For example, NURBS use "H" to bring up a sub-object hit by name dialog when in a sub-object level, but at the top-level, "H" is ignored and the system hit-by-name dialog comes up instead.

The KeyboardShortcut() method is always where the keyboard shortcut will be handled. Note:There is no need for a window proc to handle the message as the old RegisterAccelTable() call required. The old RegisterAccelTable() functionality has not been removed (for backward source compatibility) , but new plug-ins should use the new ShortcutTable mechanism.

Methods:

public:

Prototype:

virtual BOOL KeyboardShortcut(int id) = 0;

Remarks:

Implemented by the Plug-In.

This method is called when the user press a shortcut key assigned to an active table.

Parameters:

int id

The id of the operation associated with the key.

Return Value:

TRUE to process the shortcut; FALSE to ignore the shortcut and process any system shortcut for the key.