Add an input method to this viewer, e.g., mouse.
Signature:
addInput(input: Input): number;
Parameter | Description |
---|---|
input | Must be the instance of Modelo.View.Input that is compatible with current platform. |
Returns:
number
The input id in this viewer. -1 is returned if it fails to add this input.
var keyboard = new Modelo.View.Input.Keyboard(viewer);
viewer.addInput(keyboard);
keyboard.addKeyUpListener('Viewer3D', keyboard => {
if (keyboard.key === 'Escape') {
viewer.destroy();
}
return true;
});