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/nebulet/userspace/drivers/ps2/src
    
    the code of the file until where you have to start completion: //! Driver for a PS/2 keyboard.
//!
//! Only supports PS/2 Scan Code Set 2, on a UK English keyboard. See [the
//! OSDev Wiki](https://wiki.osdev.org/PS/2_Keyboard).
//!
//! Requires that you sample a pin in an interrupt routine and shift in the
//! bit. We don't sample the pin in this library, as that makes testing
//! difficult, and it means you have to make this object a global static mut
//! that the interrupt can access, which is unsafe.

// ****************************************************************************
//
// Imports
//
// ****************************************************************************

use std::marker::PhantomData;

// **************************
    
        fn map_extended_scancode(code: u8) -> Result<KeyCode, Error> {
            match code {
                0x11 => Ok(KeyCode::AltRight),     // E011
                0x14 => Ok(KeyCode::RightControl), // E014
                0x1F => Ok(KeyCode::WindowsLeft),  // E01F
                0x27 => Ok(KeyCode::WindowsRight), // E027
                0x2F => Ok(KeyCode::Menus),        // E02F
                0x4A => Ok(KeyCode::NumpadSlash),  // E04A
                0x5A => Ok(KeyCode::NumpadEnter),  // E05A
                0x69 => Ok(KeyCode::End),          // E069
                0x6B => Ok(KeyCode::LeftArrow),    // E06B
                0x6C => Ok(KeyCode::Home),         // E06C
                0x70 => Ok(KeyCode::Insert),       // E070
                0x71 => Ok(KeyCode::Delete),       // E071
                0x72 => Ok(KeyCode::DownArrow),    // E072
                0x74 => Ok(KeyCode::RightArrow),   // E074
                0x75 => Ok(KeyCode::UpArrow),      // E075
                0x7A => Ok(KeyCode::PageDown),     // E07A
                0x7D => Ok(KeyCode::PageUp),       // E07D
                _ => Err(Error::UnknownKeyCode),
            }
        }