Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,9 @@ function vtkMouseRangeManipulator(publicAPI, model) {
// we don't interfere with other events such as doubleClick,
// for this reason we don't call this from `onButtonDown`
if (model.usePointerLock && !interactor.isPointerLocked()) {
interactor.requestPointerLock();
publicAPI.startPointerLockEvent(interactor, renderer);
Promise.resolve(interactor.requestPointerLock()).then(() => {
publicAPI.startPointerLockEvent(interactor, renderer);
});
}

if (!position) {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Rendering/Core/RenderWindowInteractor/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1204,7 +1204,7 @@ export interface vtkRenderWindowInteractor extends vtkObject {
/**
*
*/
requestPointerLock(): void;
requestPointerLock(): Promise<void> | undefined;

/**
*
Expand Down
3 changes: 2 additions & 1 deletion Sources/Rendering/Core/RenderWindowInteractor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -484,8 +484,9 @@ function vtkRenderWindowInteractor(publicAPI, model) {
//----------------------------------------------------------------------
publicAPI.requestPointerLock = () => {
if (model.container) {
model.container.requestPointerLock();
return model.container.requestPointerLock();
}
return undefined;
};

//----------------------------------------------------------------------
Expand Down