Handle AddInput/RemoveInput events

This commit is contained in:
Manish Goregaokar 2020-01-08 17:54:26 +05:30
parent a90a42012b
commit f721113f8d
5 changed files with 71 additions and 5 deletions

View file

@ -289,7 +289,12 @@ impl XRSession {
);
event.upcast::<Event>().fire(self.upcast());
},
_ => (), // XXXManishearth TBD
XREvent::AddInput(info) => {
self.input_sources.add_input_source(self, info);
},
XREvent::RemoveInput(id) => {
self.input_sources.remove_input_source(self, id);
},
}
}
@ -432,6 +437,13 @@ impl XRSessionMethods for XRSession {
SetOnvisibilitychange
);
/// https://immersive-web.github.io/webxr/#eventdef-xrsession-inputsourceschange
event_handler!(
inputsourceschange,
GetOninputsourceschange,
SetOninputsourceschange
);
// https://immersive-web.github.io/webxr/#dom-xrsession-renderstate
fn RenderState(&self) -> DomRoot<XRRenderState> {
self.active_render_state.get()