aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLibravatar Silas Bartha <silas@exvacuum.dev>2024-12-20 08:00:20 -0500
committerLibravatar Silas Bartha <silas@exvacuum.dev>2024-12-20 08:00:20 -0500
commit39e8be3872232d929c4ccaa1b595bf61d656b2fe (patch)
tree7faabac275844e271ef92650b98cca58a059582e /src
parent0d7e360c7999f4470eb0096bb4e239ac8be47d87 (diff)
Vanilla Input System Integration
Diffstat (limited to 'src')
-rw-r--r--src/input/resources.rs53
1 files changed, 2 insertions, 51 deletions
diff --git a/src/input/resources.rs b/src/input/resources.rs
index 0324593..f8b9032 100644
--- a/src/input/resources.rs
+++ b/src/input/resources.rs
@@ -1,56 +1,7 @@
-use bevy::{prelude::*, utils::HashSet};
-use crossterm::event::{Event, KeyCode};
+use bevy::prelude::*;
+use crossterm::event::Event;
use std::sync::{Arc, Mutex};
-// /// Resource containing currently pressed and released keys
-// #[derive(Resource, Default)]
-// pub struct TerminalInput {
-// pressed_keys: HashSet<KeyCode>,
-// just_pressed_keys: HashSet<KeyCode>,
-// just_released_keys: HashSet<KeyCode>,
-// }
-//
-// impl TerminalInput {
-// /// Gets whether the given key is pressed
-// pub fn is_pressed(&self, code: KeyCode) -> bool {
-// self.pressed_keys.contains(&code)
-// }
-//
-// /// Gets whether the given key was just pressed
-// pub fn just_pressed(&self, code: KeyCode) -> bool {
-// self.just_pressed_keys.contains(&code)
-// }
-//
-// /// Gets whether the given key was just released
-// pub fn just_released(&self, code: KeyCode) -> bool {
-// self.just_released_keys.contains(&code)
-// }
-//
-// /// Sets given key to pressed
-// pub(super) fn press(&mut self, code: KeyCode) {
-// if !self.pressed_keys.contains(&code) {
-// self.pressed_keys.insert(code);
-// self.just_pressed_keys.insert(code);
-// }
-// }
-//
-// /// Sets given key to released and removes pressed state
-// pub(super) fn release(&mut self, code: KeyCode) {
-// self.pressed_keys.remove(&code);
-// self.just_released_keys.insert(code);
-// }
-//
-// /// Clears all just released keys
-// pub(super) fn clear_just_released(&mut self) {
-// self.just_released_keys.clear();
-// }
-//
-// /// Clears all just pressed keys
-// pub(super) fn clear_just_pressed(&mut self) {
-// self.just_pressed_keys.clear();
-// }
-// }
-
/// Event queue for crossterm input event thread
#[derive(Resource, Default)]
pub(crate) struct EventQueue(pub(super) Arc<Mutex<Vec<Event>>>);