Skip to content

Commit

Permalink
fix(objects/input) mouse pointer gives correct keymap now
Browse files Browse the repository at this point in the history
  • Loading branch information
technobaboo committed Jun 17, 2024
1 parent 53979ce commit 9b6b450
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/objects/input/mouse_pointer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use color_eyre::eyre::Result;
use glam::{vec3, Mat4, Vec3};
use mint::Vector2;
use serde::{Deserialize, Serialize};
use slotmap::DefaultKey;
use slotmap::{DefaultKey, Key as SlotKey};
use stardust_xr::values::Datamap;
use std::sync::Arc;
use stereokit_rust::system::{Input, Key};
Expand Down Expand Up @@ -48,15 +48,15 @@ impl Default for MouseEvent {
pub struct KeyboardEvent {
pub keyboard: (),
pub xkbv1: (),
pub keymap_id: String,
pub keymap_id: u64,
pub keys: Vec<i32>,
}
impl Default for KeyboardEvent {
fn default() -> Self {
Self {
keyboard: (),
xkbv1: (),
keymap_id: "flatscreen".to_string(),
keymap_id: 0,
keys: Default::default(),
}
}
Expand Down Expand Up @@ -97,12 +97,17 @@ impl MousePointer {

Ok(MousePointer {
node,
keymap,
spatial,
pointer,
capture: None,
mouse_datamap: Default::default(),
keyboard_datamap: Default::default(),
keyboard_datamap: KeyboardEvent {
keyboard: (),
xkbv1: (),
keymap_id: keymap.data().as_ffi(),
keys: vec![],
},
keymap,
keyboard_sender,
})
}
Expand Down

0 comments on commit 9b6b450

Please sign in to comment.