You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: input.rs
    path of file: ./repos/skim/src
    
    the code of the file until where you have to start completion: ///! Input will listens to user input, modify the query string, send special
///! keystrokes(such as Enter, Ctrl-p, Ctrl-n, etc) to the controller.
use crate::event::{parse_event, Event};
use regex::Regex;
use std::collections::HashMap;
use tuikit::event::Event as TermEvent;
use tuikit::key::{from_keyname, Key};

pub type ActionChain = Vec<Event>;

pub struct Input {
    keymap: HashMap<Key, ActionChain>,
}

impl Input {
    pub fn new() -> Self {
        Input {
            keymap: ge
    
    pub fn translate_event(&self, event: TermEvent) -> (Key, ActionChain) {
        match event {
            // search event from keymap
            TermEvent::Key(key) => (
                key,
                self.keymap.get(&key).cloned().unwrap_or_else(|| {
                    if let Key::Char(ch) = key {
                        vec![Event::EvActAddChar(ch)]
                    } else {
                        vec![Event::EvInputKey(key)]
                    }
                }),
            ),
            TermEvent::Resize { .. } => (Key::Null, vec![Event::EvActRedraw]),
            _ => (Key::Null, vec![Event::EvInputInvalid]),
        }
    }