Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add input mocking, input sources change event #25463

Merged
merged 15 commits into from Jan 9, 2020

Add select events

  • Loading branch information
Manishearth committed Jan 9, 2020
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);
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.