Skip to main content

furmint_input/
plugin.rs

1//! Input plugin
2
3use crate::keyboard::KeyboardInput;
4use furmint_runtime::plugins::{Plugin, PluginBuildContext, PluginUpdateContext};
5use std::error::Error;
6
7/// The input plugin itself
8pub struct InputPlugin;
9
10impl Plugin for InputPlugin {
11    fn build(&mut self, ctx: &mut PluginBuildContext<'_>) -> Result<(), Box<dyn Error>> {
12        ctx.insert_resource(KeyboardInput::default());
13        Ok(())
14    }
15
16    fn update(&mut self, _ctx: &mut PluginUpdateContext<'_>) -> Result<(), Box<dyn Error>> {
17        Ok(())
18    }
19
20    fn name(&self) -> &'static str {
21        "input_plugin"
22    }
23}