Skip to content
Permalink
Browse files

Add select events

  • Loading branch information
Manishearth committed Jan 8, 2020
1 parent 225254a commit 82002765beebed60b737d64b538bc0c33912f0e0
@@ -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,
))
}
}
@@ -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<FakeXRButtonStateInit> supportedButtons);
// void updateButtonState(FakeXRButtonStateInit buttonState);

0 comments on commit 8200276

Please sign in to comment.
You can’t perform that action at this time.