use crate::vim::KeyToken;
use bevy::prelude::Message;
#[derive(Clone, Debug, Eq, Message, PartialEq)]
pub enum EditorInputEvent {
Key(KeyInputEvent),
Text(TextInputEvent),
}
impl EditorInputEvent {
#[must_use]
pub const fn is_repeated_key(&self) -> bool {
matches!(self, Self::Key(key) if key.repeated)
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct KeyInputEvent {
pub token: KeyToken,
pub repeated: bool,
}
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct TextInputEvent {
pub text: String,
}