mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Add select events
This commit is contained in:
parent
225254a6b3
commit
82002765be
2 changed files with 28 additions and 4 deletions
|
@ -13,7 +13,7 @@ use crate::dom::fakexrdevice::get_origin;
|
||||||
use crate::dom::globalscope::GlobalScope;
|
use crate::dom::globalscope::GlobalScope;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use ipc_channel::ipc::IpcSender;
|
use ipc_channel::ipc::IpcSender;
|
||||||
use webxr_api::{InputId, MockDeviceMsg, MockInputMsg};
|
use webxr_api::{InputId, MockDeviceMsg, MockInputMsg, SelectEvent, SelectKind};
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct FakeXRInputController {
|
pub struct FakeXRInputController {
|
||||||
|
@ -79,4 +79,28 @@ impl FakeXRInputControllerMethods for FakeXRInputController {
|
||||||
fn Reconnect(&self) {
|
fn Reconnect(&self) {
|
||||||
self.send_message(MockInputMsg::Reconnect)
|
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 disconnect();
|
||||||
void reconnect();
|
void reconnect();
|
||||||
|
|
||||||
// void startSelection();
|
void startSelection();
|
||||||
// void endSelection();
|
void endSelection();
|
||||||
// void simulateSelect();
|
void simulateSelect();
|
||||||
|
|
||||||
// void setSupportedButtons(sequence<FakeXRButtonStateInit> supportedButtons);
|
// void setSupportedButtons(sequence<FakeXRButtonStateInit> supportedButtons);
|
||||||
// void updateButtonState(FakeXRButtonStateInit buttonState);
|
// void updateButtonState(FakeXRButtonStateInit buttonState);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue