cobject 0.1.1

A game engine that uses minifb as a foundation and currently only supports 2D.
Documentation
use minifb::Key;

#[repr(u8)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum CKey {
    Key0 = 0,
    Key1 = 1,
    Key2 = 2,
    Key3 = 3,
    Key4 = 4,
    Key5 = 5,
    Key6 = 6,
    Key7 = 7,
    Key8 = 8,
    Key9 = 9,
    A = 10,
    B = 11,
    C = 12,
    D = 13,
    E = 14,
    F = 15,
    G = 16,
    H = 17,
    I = 18,
    J = 19,
    K = 20,
    L = 21,
    M = 22,
    N = 23,
    O = 24,
    P = 25,
    Q = 26,
    R = 27,
    S = 28,
    T = 29,
    U = 30,
    V = 31,
    W = 32,
    X = 33,
    Y = 34,
    Z = 35,
    F1 = 36,
    F2 = 37,
    F3 = 38,
    F4 = 39,
    F5 = 40,
    F6 = 41,
    F7 = 42,
    F8 = 43,
    F9 = 44,
    F10 = 45,
    F11 = 46,
    F12 = 47,
    F13 = 48,
    F14 = 49,
    F15 = 50,
    Down = 51,
    Left = 52,
    Right = 53,
    Up = 54,
    Apostrophe = 55,
    Backquote = 56,
    Backslash = 57,
    Comma = 58,
    Equal = 59,
    LeftBracket = 60,
    Minus = 61,
    Period = 62,
    RightBracket = 63,
    Semicolon = 64,
    Slash = 65,
    Backspace = 66,
    Delete = 67,
    End = 68,
    Enter = 69,
    Escape = 70,
    Home = 71,
    Insert = 72,
    Menu = 73,
    PageDown = 74,
    PageUp = 75,
    Pause = 76,
    Space = 77,
    Tab = 78,
    NumLock = 79,
    CapsLock = 80,
    ScrollLock = 81,
    LeftShift = 82,
    RightShift = 83,
    LeftCtrl = 84,
    RightCtrl = 85,
    NumPad0 = 86,
    NumPad1 = 87,
    NumPad2 = 88,
    NumPad3 = 89,
    NumPad4 = 90,
    NumPad5 = 91,
    NumPad6 = 92,
    NumPad7 = 93,
    NumPad8 = 94,
    NumPad9 = 95,
    NumPadDot = 96,
    NumPadSlash = 97,
    NumPadAsterisk = 98,
    NumPadMinus = 99,
    NumPadPlus = 100,
    NumPadEnter = 101,
    LeftAlt = 102,
    RightAlt = 103,
    LeftSuper = 104,
    RightSuper = 105,
    Unknown = 106,
}

impl From<Key> for CKey {
    fn from(key: Key) -> CKey {
        match key {
            Key::Key0 => CKey::Key0,
            Key::Key1 => CKey::Key1,
            Key::Key2 => CKey::Key2,
            Key::Key3 => CKey::Key3,
            Key::Key4 => CKey::Key4,
            Key::Key5 => CKey::Key5,
            Key::Key6 => CKey::Key6,
            Key::Key7 => CKey::Key7,
            Key::Key8 => CKey::Key8,
            Key::Key9 => CKey::Key9,
            Key::A => CKey::A,
            Key::B => CKey::B,
            Key::C => CKey::C,
            Key::D => CKey::D,
            Key::E => CKey::E,
            Key::F => CKey::F,
            Key::G => CKey::G,
            Key::H => CKey::H,
            Key::I => CKey::I,
            Key::J => CKey::J,
            Key::K => CKey::K,
            Key::L => CKey::L,
            Key::M => CKey::M,
            Key::N => CKey::N,
            Key::O => CKey::O,
            Key::P => CKey::P,
            Key::Q => CKey::Q,
            Key::R => CKey::R,
            Key::S => CKey::S,
            Key::T => CKey::T,
            Key::U => CKey::U,
            Key::V => CKey::V,
            Key::W => CKey::W,
            Key::X => CKey::X,
            Key::Y => CKey::Y,
            Key::Z => CKey::Z,
            Key::Escape => CKey::Escape,
            Key::Space => CKey::Space,
            Key::Enter => CKey::Enter,
            Key::Tab => CKey::Tab,
            Key::LeftShift => CKey::LeftShift,
            Key::RightShift => CKey::RightShift,
            Key::LeftCtrl => CKey::LeftCtrl,
            Key::RightCtrl => CKey::RightCtrl,
            Key::LeftAlt => CKey::LeftAlt,
            Key::RightAlt => CKey::RightAlt,
            Key::Up => CKey::Up,
            Key::Down => CKey::Down,
            Key::Left => CKey::Left,
            Key::Right => CKey::Right,
            _ => CKey::Unknown,
        }
    }
}