This commit is contained in:
nora 2023-04-17 19:51:02 +02:00
parent 98dd54f1f2
commit 62107a20d8
21 changed files with 138 additions and 459 deletions

View file

@ -2,26 +2,24 @@ use fnv::FnvHashSet;
use sfml::window::{mouse, Event, Key};
use crate::graphics::ScreenVec;
#[derive(Default, Debug)]
pub struct Input {
down: FnvHashSet<Key>,
pressed: FnvHashSet<Key>,
pub lmb_down: bool,
pub rmb_down: bool,
pub mouse_down_loc: ScreenVec,
pub mid_pressed: bool,
}
pub(crate) struct Input {}
impl Input {
pub fn update_from_event(&mut self, ev: &Event, egui_kbd: bool, egui_ptr: bool) {
pub(crate) fn update_from_event(
&mut self,
ev: &Event,
egui_kbd: bool,
egui_ptr: bool,
) {
loop {}
}
/// Pressed event should be cleared every frame
pub fn clear_pressed(&mut self) {
pub(crate) fn clear_pressed(&mut self) {
loop {}
}
pub fn down(&self, key: Key) -> bool {
pub(crate) fn down(&self, key: Key) -> bool {
loop {}
}
pub fn pressed(&self, key: Key) -> bool {
pub(crate) fn pressed(&self, key: Key) -> bool {
loop {}
}
}