import pygame


def key(keystr: str):
    """key"""

    class Keyboard:
        """Keyboard"""

        keydict = {
            "BACKSPACE": pygame.K_BACKSPACE,
            "TAB": pygame.K_TAB,
            "CLEAR": pygame.K_CLEAR,
            "RETURN": pygame.K_RETURN,
            "PAUSE": pygame.K_PAUSE,
            "ESCAPE": pygame.K_ESCAPE,
            "SPACE": pygame.K_SPACE,
            "COMMA": pygame.K_COMMA,
            "MINUS": pygame.K_MINUS,
            "0": pygame.K_0,
            "1": pygame.K_1,
            "2": pygame.K_2,
            "3": pygame.K_3,
            "4": pygame.K_4,
            "5": pygame.K_5,
            "6": pygame.K_6,
            "7": pygame.K_7,
            "8": pygame.K_8,
            "9": pygame.K_9,
            "a": pygame.K_a,
            "b": pygame.K_b,
            "c": pygame.K_c,
            "d": pygame.K_d,
            "e": pygame.K_e,
            "f": pygame.K_f,
            "g": pygame.K_g,
            "h": pygame.K_h,
            "i": pygame.K_i,
            "j": pygame.K_j,
            "k": pygame.K_k,
            "l": pygame.K_l,
            "m": pygame.K_m,
            "n": pygame.K_n,
            "o": pygame.K_o,
            "p": pygame.K_p,
            "q": pygame.K_q,
            "r": pygame.K_r,
            "s": pygame.K_s,
            "t": pygame.K_t,
            "u": pygame.K_u,
            "v": pygame.K_v,
            "w": pygame.K_w,
            "x": pygame.K_x,
            "y": pygame.K_y,
            "z": pygame.K_z,
            "DELETE": pygame.K_DELETE,
            "NUMPAD_0": pygame.K_KP0,
            "NUMPAD_1": pygame.K_KP1,
            "NUMPAD_2": pygame.K_KP2,
            "NUMPAD_3": pygame.K_KP3,
            "NUMPAD_4": pygame.K_KP4,
            "NUMPAD_5": pygame.K_KP5,
            "NUMPAD_6": pygame.K_KP6,
            "NUMPAD_7": pygame.K_KP7,
            "NUMPAD_8": pygame.K_KP8,
            "NUMPAD_9": pygame.K_KP9,
            "NUMPAD_PERIOD": pygame.K_KP_PERIOD,
            "NUMPAD_SLASH": pygame.K_KP_DIVIDE,
            "NUMPAD_ASTERISC": pygame.K_KP_MULTIPLY,
            "NUMPAD_MINUS": pygame.K_KP_MINUS,
            "NUMPAD_PLUS": pygame.K_KP_PLUS,
            "NUMPAD_ENTER": pygame.K_KP_ENTER,
            "NUMPAD_EQUALS": pygame.K_KP_EQUALS,
            "UP": pygame.K_UP,
            "DOWN": pygame.K_DOWN,
            "RIGHT": pygame.K_RIGHT,
            "LEFT": pygame.K_LEFT,
            "INSERT": pygame.K_INSERT,
            "HOME": pygame.K_HOME,
            "END": pygame.K_END,
            "PAGEUP": pygame.K_PAGEUP,
            "PAGEDOWN": pygame.K_PAGEDOWN,
            "F1": pygame.K_F1,
            "F2": pygame.K_F2,
            "F3": pygame.K_F3,
            "F4": pygame.K_F4,
            "F5": pygame.K_F5,
            "F6": pygame.K_F6,
            "F7": pygame.K_F7,
            "F8": pygame.K_F8,
            "F9": pygame.K_F9,
            "F10": pygame.K_F10,
            "F11": pygame.K_F11,
            "F12": pygame.K_F12,
            "F13": pygame.K_F13,
            "F14": pygame.K_F14,
            "F15": pygame.K_F15,
            "SHIFT_RIGHT": pygame.K_RSHIFT,
            "SHIFT_LEFT": pygame.K_LSHIFT,
            "CTRL_RIGHT": pygame.K_RCTRL,
            "CTRL_LEFT": pygame.K_LCTRL,
            "ALT_RIGHT": pygame.K_RALT,
            "ALT_LEFT ": pygame.K_LALT,
        }

    return Keyboard().keydict[keystr.upper()]
