Request

Response

    Autodesk.Viewing
    Version 8 preview
    This page documents a preview of the Viewer SDK v8. APIs and content can still change before the final release.

    HotkeyManager

    Management of hotkeys for the viewer.

    new HotkeyManager()

    Methods

    getNames()

    Return name of the tool returned as an array

    Returns

    typedescription
    Array.<string> [“hotkeys”]

    getName()

    Return name of HotkeyManager tool

    Returns

    typedescription
    string “hotkeys”

    pushHotkeys(id, hotkeys, options)

    Pushes new hotkeys onto the stack.

    Parameters

    Expand all
    id*
    string
    The id for this hotkey set.
    hotkeys*
    Array.<HotkeyManager~Hotkey>
    The list of hotkeys.
    options
    object
    An optional dictionary of options for this hotkey set.
    tryUntilSuccess
    boolean
    When true, the onPress callback will be called until it returns true or the hotkey state changes. The onRelease callback will be called until it returns true or until the combination is reengaged. Stops propagation through the stack. Non-blocking.
    * Required

    Returns

    typedescription
    boolean True if the hotkeys were successfully pushed.

    popHotkeys(id)

    Removes hotkeys associated with an ID from the stack.

    Parameters

    id*
    string
    The id associated with the hotkeys.
    * Required

    Returns

    typedescription
    boolean True if the hotkeys were successfully popped.

    handleKeyDown(event, keyCode)

    Parameters

    event*
    KeyboardEvent
    Event to handle
    keyCode*
    number
    Key code
    * Required

    handleKeyUp(event, keyCode)

    Parameters

    event*
    KeyboardEvent
    Event to handle
    keyCode*
    number
    Key code
    * Required

    handleBlur()

    Handle blur by releasing all current keys

    activate()

    No-op

    deactivate()

    No-op