diff --git a/components/script/dom/fakexrinputcontroller.rs b/components/script/dom/fakexrinputcontroller.rs index 4756baf5f0a..67e6f72cf70 100644 --- a/components/script/dom/fakexrinputcontroller.rs +++ b/components/script/dom/fakexrinputcontroller.rs @@ -13,7 +13,7 @@ use crate::dom::fakexrdevice::get_origin; use crate::dom::globalscope::GlobalScope; use dom_struct::dom_struct; use ipc_channel::ipc::IpcSender; -use webxr_api::{InputId, MockDeviceMsg, MockInputMsg}; +use webxr_api::{InputId, MockDeviceMsg, MockInputMsg, SelectEvent, SelectKind}; #[dom_struct] pub struct FakeXRInputController { @@ -79,4 +79,28 @@ impl FakeXRInputControllerMethods for FakeXRInputController { fn Reconnect(&self) { self.send_message(MockInputMsg::Reconnect) } + + /// https://immersive-web.github.io/webxr-test-api/#dom-fakexrinputcontroller-startselection + fn StartSelection(&self) { + self.send_message(MockInputMsg::TriggerSelect( + SelectKind::Select, + SelectEvent::Start, + )) + } + + /// https://immersive-web.github.io/webxr-test-api/#dom-fakexrinputcontroller-endselection + fn EndSelection(&self) { + self.send_message(MockInputMsg::TriggerSelect( + SelectKind::Select, + SelectEvent::End, + )) + } + + /// https://immersive-web.github.io/webxr-test-api/#dom-fakexrinputcontroller-simulateselect + fn SimulateSelect(&self) { + self.send_message(MockInputMsg::TriggerSelect( + SelectKind::Select, + SelectEvent::Select, + )) + } } diff --git a/components/script/dom/webidls/FakeXRInputController.webidl b/components/script/dom/webidls/FakeXRInputController.webidl index bdfd00a6f91..a50950cdee3 100644 --- a/components/script/dom/webidls/FakeXRInputController.webidl +++ b/components/script/dom/webidls/FakeXRInputController.webidl @@ -16,9 +16,9 @@ interface FakeXRInputController { void disconnect(); void reconnect(); - // void startSelection(); - // void endSelection(); - // void simulateSelect(); + void startSelection(); + void endSelection(); + void simulateSelect(); // void setSupportedButtons(sequence supportedButtons); // void updateButtonState(FakeXRButtonStateInit buttonState);