mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +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 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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue