From 51b7747e62c189d430318c67368a5c84e50ece61 Mon Sep 17 00:00:00 2001 From: Arne Dußin Date: Sun, 17 Jan 2021 13:33:04 +0100 Subject: Input revamp to make keybindings controlable. --- src/input/binding.rs | 123 +++++++++++++++++++++++++++++++ src/input/button.rs | 177 +++++++++++++++++++++++++++++++++++++++++++++ src/input/mod.rs | 200 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 500 insertions(+) create mode 100644 src/input/binding.rs create mode 100644 src/input/button.rs create mode 100644 src/input/mod.rs (limited to 'src/input') diff --git a/src/input/binding.rs b/src/input/binding.rs new file mode 100644 index 0000000..386fb66 --- /dev/null +++ b/src/input/binding.rs @@ -0,0 +1,123 @@ +//! Bindings module, which is a key combination that does something when pressed. + +use super::Button; +use raylib::RaylibHandle; +use serde::{Deserialize, Serialize}; + +/// Binding struct, which holds any number of buttons (keyboard and mouse may be mixed, if desired) +#[derive(Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] +pub struct Binding { + buttons: Vec