make keyboard use vkey codes; add 4x4 rom

This commit is contained in:
Redo0
2021-05-25 05:18:55 -05:00
parent ce07ef3263
commit 95164ab7bf
3 changed files with 1068 additions and 93 deletions

View File

@ -8,104 +8,112 @@ keyboard_strToBool = {
--Key codes may use only 7 bits, so values must be in range 00-7F
keyboard_keyToCode = {
["backspace"] = 0x01,
["tab"] = 0x02,
["return"] = 0x03,
["space"] = 0x04,
["end"] = 0x05,
["home"] = 0x06,
["left"] = 0x07,
["up"] = 0x08,
["right"] = 0x09,
["down"] = 0x0A,
["insert"] = 0x0B,
["delete"] = 0x0C,
["backspace"] = 8,
["tab"] = 9,
["return"] = 13,
["0"] = 0x10,
["1"] = 0x11,
["2"] = 0x12,
["3"] = 0x13,
["4"] = 0x14,
["5"] = 0x15,
["6"] = 0x16,
["7"] = 0x17,
["8"] = 0x18,
["9"] = 0x19,
["lshift"] = 16,
["lcontrol"] = 17,
["lalt"] = 18,
["a"] = 0x1A,
["b"] = 0x1B,
["c"] = 0x1C,
["d"] = 0x1D,
["e"] = 0x1E,
["f"] = 0x1F,
["g"] = 0x20,
["h"] = 0x21,
["i"] = 0x22,
["j"] = 0x23,
["k"] = 0x24,
["l"] = 0x25,
["m"] = 0x26,
["n"] = 0x27,
["o"] = 0x28,
["p"] = 0x29,
["q"] = 0x2A,
["r"] = 0x2B,
["s"] = 0x2C,
["t"] = 0x2D,
["u"] = 0x2E,
["v"] = 0x2F,
["w"] = 0x30,
["x"] = 0x31,
["y"] = 0x32,
["z"] = 0x33,
-- this block does not match vkey codes
["rshift"] = 20,
["rcontrol"] = 21,
["ralt"] = 22,
["numpad0"] = 0x40,
["numpad1"] = 0x41,
["numpad2"] = 0x42,
["numpad3"] = 0x43,
["numpad4"] = 0x44,
["numpad5"] = 0x45,
["numpad6"] = 0x46,
["numpad7"] = 0x47,
["numpad8"] = 0x48,
["numpad9"] = 0x49,
["*"] = 0x4A,
["+"] = 0x4B,
["numpadenter"] = 0x4C,
["minus"] = 0x4D,
["numpaddecimal"] = 0x4E,
["/"] = 0x4F,
-- this block does not match vkey codes
[";"] = 24,
["="] = 25,
[","] = 26,
["."] = 27,
["/"] = 29,
["`"] = 30,
["f1"] = 0x51,
["f2"] = 0x52,
["f3"] = 0x53,
["f4"] = 0x54,
["f5"] = 0x55,
["f6"] = 0x56,
["f7"] = 0x57,
["f8"] = 0x58,
["f9"] = 0x59,
["f10"] = 0x5A,
["f11"] = 0x5B,
["f12"] = 0x5C,
["space"] = 32,
["pageup"] = 33,
["pagedown"] = 34,
["end"] = 35,
["home"] = 36,
["left"] = 37,
["up"] = 38,
["right"] = 39,
["down"] = 40,
["insert"] = 45,
["delete"] = 46,
["lshift"] = 0x60,
["rshift"] = 0x61,
["lcontrol"] = 0x62,
["rcontrol"] = 0x63,
["lalt"] = 0x64,
["ralt"] = 0x65,
["0"] = 48,
["1"] = 49,
["2"] = 50,
["3"] = 51,
["4"] = 52,
["5"] = 53,
["6"] = 54,
["7"] = 55,
["8"] = 56,
["9"] = 57,
[";"] = 0x70,
[","] = 0x71,
["."] = 0x72,
["/"] = 0x73,
["`"] = 0x74,
["["] = 0x75,
["\\"] = 0x76,
["]"] = 0x77,
["="] = 0x78,
["apostrophe"] = 0x79,
-- this block does not match vkey codes
["["] = 60,
["\\"] = 61,
["]"] = 62,
["apostrophe"] = 63,
["invalid"] = 0x7F,
["a"] = 65,
["b"] = 66,
["c"] = 67,
["d"] = 68,
["e"] = 69,
["f"] = 70,
["g"] = 71,
["h"] = 72,
["i"] = 73,
["j"] = 74,
["k"] = 75,
["l"] = 76,
["m"] = 77,
["n"] = 78,
["o"] = 79,
["p"] = 80,
["q"] = 81,
["r"] = 82,
["s"] = 83,
["t"] = 84,
["u"] = 85,
["v"] = 86,
["w"] = 87,
["x"] = 88,
["y"] = 89,
["z"] = 90,
["numpad0"] = 96,
["numpad1"] = 97,
["numpad2"] = 98,
["numpad3"] = 99,
["numpad4"] = 100,
["numpad5"] = 101,
["numpad6"] = 102,
["numpad7"] = 103,
["numpad8"] = 104,
["numpad9"] = 105,
["*"] = 106,
["+"] = 107,
["numpadenter"] = 108,
["minus"] = 109,
["numpaddecimal"] = 110,
["/"] = 111,
["f1"] = 112,
["f2"] = 113,
["f3"] = 114,
["f4"] = 115,
["f5"] = 116,
["f6"] = 117,
["f7"] = 118,
["f8"] = 119,
["f9"] = 120,
["f10"] = 121,
["f11"] = 122,
["f12"] = 123,
["invalid"] = 127,
}