pub struct XrMetaVirtualKeyboardStepper { /* private fields */ }
Expand description
IStepper implementation for XR_META_virtual_keyboard integration with StereoKit
This stepper provides virtual keyboard functionality using the OpenXR XR_META_virtual_keyboard extension.
§Events this stepper is listening to:
KEYBOARD_SHOW
- Event that triggers showing (“1”) or hiding (“0”) the virtual keyboard.
§Examples
use stereokit_rust::tools::xr_meta_virtual_keyboard::*;
number_of_steps = 50;
test_steps!( // !!!! Get a proper main loop !!!!
if iter == 10 {
// Create and test virtual keyboard functionality
if is_meta_virtual_keyboard_extension_available() {
let mut keyboard_stepper = XrMetaVirtualKeyboardStepper::new(true);
sk.send_event(StepperAction::add("keyboard_test", keyboard_stepper));
// Show the keyboard
sk.send_event(StepperAction::event("keyboard_test", KEYBOARD_SHOW, "1"));
Log::info("✅ Virtual keyboard shown");
}
}
if iter == 30 {
// Hide the keyboard
sk.send_event(StepperAction::event("keyboard_test", KEYBOARD_SHOW, "0"));
Log::info("✅ Virtual keyboard hidden");
}
);
Implementations§
Source§impl XrMetaVirtualKeyboardStepper
impl XrMetaVirtualKeyboardStepper
Sourcepub fn new(enable_on_init: bool) -> Self
pub fn new(enable_on_init: bool) -> Self
Creates a new virtual keyboard stepper
§Arguments
enable_on_init
- If true, keyboard will be enabled immediately upon initialization
§Returns
A new XrMetaVirtualKeyboardStepper
instance ready for integration with StereoKit
§Examples
use stereokit_rust::tools::xr_meta_virtual_keyboard::*;
number_of_steps = 40;
test_steps!( // !!!! Get a proper main loop !!!!
if iter == 10 {
// Test creating keyboard stepper with different configurations
let keyboard1 = XrMetaVirtualKeyboardStepper::new(false);
// Add steppers to StereoKit for testing
sk.send_event(StepperAction::add("keyboard_test1", keyboard1));
} else if iter == 30 {
// Test keyboard control events
sk.send_event(StepperAction::event("keyboard_test1", KEYBOARD_SHOW, "false"));
} else if iter == 35 {
// Clean up steppers
sk.send_event(StepperAction::remove("keyboard_test1"));
}
);
Trait Implementations§
Source§impl IStepper for XrMetaVirtualKeyboardStepper
impl IStepper for XrMetaVirtualKeyboardStepper
Source§fn enabled(&self) -> bool
fn enabled(&self) -> bool
Is this IStepper enabled? When false, StereoKit will not call Step. This can be a good way to temporarily
disable the IStepper without removing or shutting it down.
https://stereokit.net/Pages/StereoKit.Framework/IStepper/Enabled.html
Source§fn initialize(&mut self, id: StepperId, sk_info: Rc<RefCell<SkInfo>>) -> bool
fn initialize(&mut self, id: StepperId, sk_info: Rc<RefCell<SkInfo>>) -> bool
This is called by StereoKit at the start of the next frame, and on the main thread. This happens before
StereoKit’s main Step callback, and always after Sk.initialize.
https://stereokit.net/Pages/StereoKit.Framework/IStepper/Initialize.html
id : The id of the stepper
sk : The SkInfo of the runnin Sk instance. Read more
Source§fn step(&mut self, token: &MainThreadToken)
fn step(&mut self, token: &MainThreadToken)
This Step method will be called every frame of the application, as long as Enabled is true. This happens
immediately before the main application’s Step callback.
https://stereokit.net/Pages/StereoKit.Framework/IStepper/Step.html
Source§fn shutdown(&mut self)
fn shutdown(&mut self)
This is called when the IStepper is removed, or the application shuts down. This is always called on the main
thread, and happens at the start of the next frame, before the main application’s Step callback.
https://stereokit.net/Pages/StereoKit.Framework/IStepper/Shutdown.html
Source§fn shutdown_done(&mut self) -> bool
fn shutdown_done(&mut self) -> bool
If shutdown is to be performed in multiple steps, with or without threads and in order to avoid black or
frozen screens, write the on going shutdown here Read more
Source§fn initialize_done(&mut self) -> bool
fn initialize_done(&mut self) -> bool
If initialization is to be performed in multiple steps, with or without threads and in order to avoid black or
frozen screens, write the on going initialization here Read more
impl Send for XrMetaVirtualKeyboardStepper
Auto Trait Implementations§
impl Freeze for XrMetaVirtualKeyboardStepper
impl !RefUnwindSafe for XrMetaVirtualKeyboardStepper
impl !Sync for XrMetaVirtualKeyboardStepper
impl Unpin for XrMetaVirtualKeyboardStepper
impl !UnwindSafe for XrMetaVirtualKeyboardStepper
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.