keyboard works

This commit is contained in:
galister
2025-06-20 05:31:37 +09:00
parent b9edb75867
commit d9b3b99e0d
6 changed files with 86 additions and 27 deletions

View File

@@ -80,7 +80,7 @@ impl InteractionHandler for GuiPanel {
self.layout
.push_event(&WguiEvent::MouseWheel(MouseWheelEvent {
shift: vec2(delta_x, delta_y),
pos: hit.uv,
pos: hit.uv * self.layout.content_size,
device: hit.pointer,
}))
.unwrap();
@@ -89,7 +89,7 @@ impl InteractionHandler for GuiPanel {
fn on_hover(&mut self, _app: &mut AppState, hit: &PointerHit) -> Option<Haptics> {
self.layout
.push_event(&WguiEvent::MouseMotion(MouseMotionEvent {
pos: hit.uv,
pos: hit.uv * self.layout.content_size,
device: hit.pointer,
}))
.unwrap();
@@ -114,7 +114,7 @@ impl InteractionHandler for GuiPanel {
if pressed {
self.layout
.push_event(&WguiEvent::MouseDown(MouseDownEvent {
pos: hit.uv,
pos: hit.uv * self.layout.content_size,
button,
device: hit.pointer,
}))
@@ -122,7 +122,7 @@ impl InteractionHandler for GuiPanel {
} else {
self.layout
.push_event(&WguiEvent::MouseUp(MouseUpEvent {
pos: hit.uv,
pos: hit.uv * self.layout.content_size,
button,
device: hit.pointer,
}))