add offset / scrolling + clipboard support
This commit is contained in:
@@ -3,7 +3,7 @@ use ui::{
|
||||
layout::Vec2,
|
||||
};
|
||||
use winit::{
|
||||
event::{MouseButton, WindowEvent},
|
||||
event::{MouseButton, MouseScrollDelta, WindowEvent},
|
||||
keyboard::{Key, NamedKey},
|
||||
};
|
||||
|
||||
@@ -32,6 +32,13 @@ impl Input {
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
WindowEvent::MouseWheel { delta, .. } => {
|
||||
let delta = match *delta {
|
||||
MouseScrollDelta::LineDelta(x, y) => Vec2::new(x, y),
|
||||
MouseScrollDelta::PixelDelta(pos) => Vec2::new(pos.x as f32, pos.y as f32),
|
||||
};
|
||||
self.cursor.scroll_delta = delta;
|
||||
}
|
||||
WindowEvent::CursorLeft { .. } => {
|
||||
self.cursor.exists = false;
|
||||
self.modifiers.clear();
|
||||
@@ -56,7 +63,7 @@ impl Input {
|
||||
}
|
||||
|
||||
pub fn end_frame(&mut self) {
|
||||
self.cursor.buttons.end_frame();
|
||||
self.cursor.end_frame();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user