#!/usr/bin/env python
# -*- encoding: utf-8


from fenrirscreenreader.core.i18n import _


class command:
    def __init__(self):
        pass

    def initialize(self, environment):
        self.env = environment
        self.key_macro = [
            [1, "KEY_LEFTCTRL"],
            [1, "KEY_G"],
            [0.05, "SLEEP"],
            [0, "KEY_G"],
            [0, "KEY_LEFTCTRL"],
        ]

    def shutdown(self):
        pass

    def get_description(self):
        return "Learn about the Nano text editor."

    def run(self):
        self.env["runtime"]["OutputManager"].present_text(
            "Okay, loading the information about Nano.", interrupt=True
        )
        self.env["runtime"]["InputManager"].send_keys(self.key_macro)

    def set_callback(self, callback):
        pass
