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: keyboard.rs
    path of file: ./repos/spyglass/crates/shared/src
    
    the code of the file until where you have to start completion: // Copyright 2014-2021 The winit contributors
// Copyright 2021-2022 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0

//! **UNSTABLE** -- Types related to the keyboard.

// This file contains a substantial portion of the UI Events Specification by the W3C. In
// particular, the variant names within `Key` and `KeyCode` and their documentation are modified
// versions of contents of the aforementioned specification.
//
// The original documents are:
//
// ### For `Key`
// UI Events KeyboardEvent key Values
// https://www.w3.org/TR/2017/CR-uievents-key-20170601/
// Copyright © 2017 W3C® (MIT, ERCIM, Keio, Beihang).
//
// ### For `KeyCode`
// UI Events KeyboardEvent code Values
// https://www.w3.org/TR/2017/CR-uievents-code-20170601/
// 
    
    fn from_str(accelerator_string: &str) -> Result<Self, Self::Err> {
        let keycode = match accelerator_string.to_uppercase().as_str() {
            "`" | "BACKQUOTE" => KeyCode::Backquote,
            "BACKSLASH" => KeyCode::Backslash,
            "[" | "BRACKETLEFT" => KeyCode::BracketLeft,
            "]" | "BRACKETRIGHT" => KeyCode::BracketRight,
            "," | "COMMA" => KeyCode::Comma,
            "0" | "DIGIT0" => KeyCode::Digit0,
            "1" | "DIGIT1" => KeyCode::Digit1,
            "2" | "DIGIT2" => KeyCode::Digit2,
            "3" | "DIGIT3" => KeyCode::Digit3,
            "4" | "DIGIT4" => KeyCode::Digit4,
            "5" | "DIGIT5" => KeyCode::Digit5,
            "6" | "DIGIT6" => KeyCode::Digit6,
            "7" | "DIGIT7" => KeyCode::Digit7,
            "8" | "DIGIT8" => KeyCode::Digit8,
            "9" | "DIGIT9" => KeyCode::Digit9,
            "NUM0" | "NUMPAD0" => KeyCode::Numpad0,
            "NUM1" | "NUMPAD1" => KeyCode::Numpad1,
            "NUM2" | "NUMPAD2" => KeyCode::Numpad2,
            "NUM3" | "NUMPAD3" => KeyCode::Numpad3,
            "NUM4" | "NUMPAD4" => KeyCode::Numpad4,
            "NUM5" | "NUMPAD5" => KeyCode::Numpad5,
            "NUM6" | "NUMPAD6" => KeyCode::Numpad6,
            "NUM7" | "NUMPAD7" => KeyCode::Numpad7,
            "NUM8" | "NUMPAD8" => KeyCode::Numpad8,
            "NUM9" | "NUMPAD9" => KeyCode::Numpad9,
            "=" | "EQUAL" => KeyCode::Equal,
            "-" | "MINUS" => KeyCode::Minus,
            "PLUS" => KeyCode::Plus,
            "." | "PERIOD" => KeyCode::Period,
            "'" | "QUOTE" => KeyCode::Quote,
            "\\" => KeyCode::IntlBackslash,
            "A" => KeyCode::KeyA,
            "B" => KeyCode::KeyB,
            "C" => KeyCode::KeyC,
            "D" => KeyCode::KeyD,
            "E" => KeyCode::KeyE,
            "F" => KeyCode::KeyF,
            "G" => KeyCode::KeyG,
            "H" => KeyCode::KeyH,
            "I" => KeyCode::KeyI,
            "J" => KeyCode::KeyJ,
            "K" => KeyCode::KeyK,
            "L" => KeyCode::KeyL,
            "M" => KeyCode::KeyM,
            "N" => KeyCode::KeyN,
            "O" => KeyCode::KeyO,
            "P" => KeyCode::KeyP,
            "Q" => KeyCode::KeyQ,
            "R" => KeyCode::KeyR,
            "S" => KeyCode::KeyS,
            "T" => KeyCode::KeyT,
            "U" => KeyCode::KeyU,
            "V" => KeyCode::KeyV,
            "W" => KeyCode::KeyW,
            "X" => KeyCode::KeyX,
            "Y" => KeyCode::KeyY,
            "Z" => KeyCode::KeyZ,

            ";" | "SEMICOLON" => KeyCode::Semicolon,
            "/" | "SLASH" => KeyCode::Slash,
            "BACKSPACE" => KeyCode::Backspace,
            "CAPSLOCK" => KeyCode::CapsLock,
            "CONTEXTMENU" => KeyCode::ContextMenu,
            "ENTER" => KeyCode::Enter,
            "SPACE" => KeyCode::Space,
            "TAB" => KeyCode::Tab,
            "CONVERT" => KeyCode::Convert,

            "DELETE" => KeyCode::Delete,
            "END" => KeyCode::End,
            "HELP" => KeyCode::Help,
            "HOME" => KeyCode::Home,
            "PAGEDOWN" => KeyCode::PageDown,
            "PAGEUP" => KeyCode::PageUp,

            "DOWN" | "ARROWDOWN" => KeyCode::ArrowDown,
            "UP" | "ARROWUP" => KeyCode::ArrowUp,
            "LEFT" | "ARROWLEFT" => KeyCode::ArrowLeft,
            "RIGHT" | "ARROWRIGHT" => KeyCode::ArrowRight,

            "NUMLOCK" => KeyCode::NumLock,
            "NUMADD" | "NUMPADADD" => KeyCode::NumpadAdd,
            "NUMBACKSPACE" | "NUMPADBACKSPACE" => KeyCode::NumpadBackspace,
            "NUMCLEAR" | "NUMPADCLEAR" => KeyCode::NumpadClear,
            "NUMCOMMA" | "NUMPADCOMMA" => KeyCode::NumpadComma,
            "NUMDIVIDE" | "NUMPADDIVIDE" => KeyCode::NumpadDivide,
            "NUMSUBSTRACT" | "NUMPADSUBSTRACT" => KeyCode::NumpadSubtract,
            "NUMENTER" | "NUMPADENTER" => KeyCode::NumpadEnter,

            "ESC" | "ESCAPE" => KeyCode::Escape,
            "FN" => KeyCode::Fn,
            "FNLOCK" => KeyCode::FnLock,
            "PRINTSCREEN" => KeyCode::PrintScreen,
            "SCROLLLOCK" => KeyCode::ScrollLock,

            "PAUSE" => KeyCode::Pause,

            "VOLUMEMUTE" => KeyCode::AudioVolumeMute,
            "VOLUMEDOWN" => KeyCode::AudioVolumeDown,
            "VOLUMEUP" => KeyCode::AudioVolumeUp,
            "MEDIANEXTTRACK" => KeyCode::MediaTrackNext,
            "MEDIAPREVIOUSTRACK" => KeyCode::MediaTrackPrevious,
            "MEDIAPLAYPAUSE" => KeyCode::MediaPlayPause,
            "LAUNCHMAIL" => KeyCode::LaunchMail,

            "SUSPEND" => KeyCode::Suspend,
            "F1" => KeyCode::F1,
            "F2" => KeyCode::F2,
            "F3" => KeyCode::F3,
            "F4" => KeyCode::F4,
            "F5" => KeyCode::F5,
            "F6" => KeyCode::F6,
            "F7" => KeyCode::F7,
            "F8" => KeyCode::F8,
            "F9" => KeyCode::F9,
            "F10" => KeyCode::F10,
            "F11" => KeyCode::F11,
            "F12" => KeyCode::F12,
            "F13" => KeyCode::F13,
            "F14" => KeyCode::F14,
            "F15" => KeyCode::F15,
            "F16" => KeyCode::F16,
            "F17" => KeyCode::F17,
            "F18" => KeyCode::F18,
            "F19" => KeyCode::F19,
            "F20" => KeyCode::F20,
            "F21" => KeyCode::F21,
            "F22" => KeyCode::F22,
            "F23" => KeyCode::F23,
            "F24" => KeyCode::F24,
            "F25" => KeyCode::F25,
            "F26" => KeyCode::F26,
            "F27" => KeyCode::F27,
            "F28" => KeyCode::F28,
            "F29" => KeyCode::F29,
            "F30" => KeyCode::F30,
            "F31" => KeyCode::F31,
            "F32" => KeyCode::F32,
            "F33" => KeyCode::F33,
            "F34" => KeyCode::F34,
            "F35" => KeyCode::F35,
            _ => KeyCode::Unidentified(NativeKeyCode::Unidentified),
        };

        Ok(keycode)
    }