1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//! Handles key input events
#![allow(deprecated)]
use crate::EditorState;

use super::key::{KeyEvent, KeyEventHandler};

#[derive(Clone, Debug)]
#[deprecated(since = "0.6.0", note = "Use EditorEventHandler instead.")]
pub struct EditorInput {
    event_handler: KeyEventHandler,
}

impl EditorInput {
    pub fn on_key<T>(&mut self, key: T, state: &mut EditorState)
    where
        T: Into<KeyEvent> + Copy,
    {
        self.event_handler.on_event(key, state);
    }
}