CompositeKeyboardManipulator

Methods

onKeyDown

Handles a keydown event.

Argument Type Required Description
interactor Yes the interactor
renderer Yes the renderer
key Yes the key

onKeyPress

Handles a keypress event.

Argument Type Required Description
interactor Yes the interactor
renderer Yes the renderer
key Yes the key

onKeyUp

Handles a keyup event.

Argument Type Required Description
interactor Yes the interactor
renderer Yes the renderer
key Yes the key

Source

index.d.ts
import vtkRenderer from '../../../Rendering/Core/Renderer';
import vtkRenderWindowInteractor from '../../../Rendering/Core/RenderWindowInteractor';

export interface vtkCompositeKeyboardManipulator {
/**
* Handles a keypress event.
* @param interactor the interactor
* @param renderer the renderer
* @param key the key
*/
onKeyPress(
interactor: vtkRenderWindowInteractor,
renderer: vtkRenderer,
key: KeyboardEvent['key']
): void;

/**
* Handles a keydown event.
* @param interactor the interactor
* @param renderer the renderer
* @param key the key
*/
onKeyDown(
interactor: vtkRenderWindowInteractor,
renderer: vtkRenderer,
key: KeyboardEvent['key']
): void;

/**
* Handles a keyup event.
* @param interactor the interactor
* @param renderer the renderer
* @param key the key
*/
onKeyUp(
interactor: vtkRenderWindowInteractor,
renderer: vtkRenderer,
key: KeyboardEvent['key']
): void;
}

export function extend(publicAPI: object, model: object): void;

export const vtkCompositeKeyboardManipulator: {
extend: typeof extend;
};

export default vtkCompositeKeyboardManipulator;
index.js
// ----------------------------------------------------------------------------
// vtkCompositeKeyboardManipulator methods
// ----------------------------------------------------------------------------

function vtkCompositeKeyboardManipulator(publicAPI, model) {
// Set our className
model.classHierarchy.push('vtkCompositeKeyboardManipulator');

publicAPI.onKeyPress = (interactor, renderer, key) => {};
publicAPI.onKeyDown = (interactor, renderer, key) => {};
publicAPI.onKeyUp = (interactor, renderer, key) => {};
}

// ----------------------------------------------------------------------------
// Object factory
// ----------------------------------------------------------------------------

const DEFAULT_VALUES = {};

// ----------------------------------------------------------------------------

export function extend(publicAPI, model, initialValues = {}) {
Object.assign(model, DEFAULT_VALUES, initialValues);

// Object specific methods
vtkCompositeKeyboardManipulator(publicAPI, model);
}

// ----------------------------------------------------------------------------

export default { extend };