So I've been messing around with this mod and I noticed that when I do getName(2) I get 'one' and it'd make more sence if it returned '1'.
I noticed this because I was coding some sort of number "writing" to variable that went like this:
local char={}
local _,k
repeat
term.clear()
print('Please type some numbers:')
print(table.concat(char))
repeat
_,k=os.pullEvent('key')
until tonumber(keys.getName(k))~=nil or keys.getName(k)=='backspace' or keys.getName(k)=='enter'
if keys.getName(k)=='backspace' then
char[#char]=nil
elseif keys.getName(k)~='enter' then
char[#char+1]=keys.getName(k)
end
until keys.getName(k)=='enter'
local final=tonumber(table.concat(char))
Basicly if what you typed was a number this'd record it into the variable 'char,' if you press enter then it'll save all the characters in 'char' into another variable called 'final' in number form, thing is I get nil when I try to transform any recorder number into a number type variable because lua doesn't identify 'one' as number and returns nil if I do tonumber('one').
I've looked in the 'keys' file inside the 'apis' folder and decided to modify it.
I belive that changing tKeys table to this would make everyone a little happier no ?
local tKeys = {
nil, "1", "2", "3", "4", -- 1
"5", "6", "7", "8", "9", -- 6
"0", "-", "=", "backspace","tab", -- 11
"q", "w", "e", "r", "t", -- 16
"y", "u", "i", "o", "p", -- 21
"leftBracket","rightBracket","enter","leftCtrl","a", -- 26
"s", "d", "f", "g", "h", -- 31
"j", "k", "l", ";", "'", -- 36
"grave", "leftShift","backSlash", "z", "x", -- 41
"c", "v", "b", "n", "m", -- 46
",", ".", "/", "rightShift","*", -- 51
"leftAlt", "space", "capsLock", "f1", "f2", -- 56
"f3", "f4", "f5", "f6", "f7", -- 61
"f8", "f9", "f10", "numLock", "scollLock", -- 66
"numPad7", "numPad8", "numPad9", "numPadSubtract","numPad4", -- 71
"numPad5", "numPad6", "numPadAdd","numPad1", "numPad2", -- 76
"numPad3", "numPad0", "numPadDecimal",nil, nil, -- 81
nil, "f11", "f12", nil, nil, -- 86
nil, nil, nil, nil, nil, -- 91
nil, nil, nil, nil, "f13", -- 96
"f14", "f15", nil, nil, nil, -- 101
nil, nil, nil, nil, nil, -- 106
nil, "kana", nil, nil, nil, -- 111
nil, nil, nil, nil, nil, -- 116
"convert", nil, "noconvert",nil, "yen", -- 121
nil, nil, nil, nil, nil, -- 126
nil, nil, nil, nil, nil, -- 131
nil, nil, nil, nil, nil, -- 136
"numPadEquals",nil, nil, "cimcumflex","@", -- 141
"colon", "_", "kanji", "stop", "ax", -- 146
nil, "numPadEnter","rightCtrl",nil, nil, -- 151
nil, nil, nil, nil, nil, -- 156
nil, nil, nil, nil, nil, -- 161
nil, nil, nil, nil, nil, -- 166
nil, nil, nil, nil, nil, -- 171
nil, nil, nil, "numPadComma",nil, -- 176
"numPadDivide",nil, nil, "rightAlt", nil, -- 181
nil, nil, nil, nil, nil, -- 186
nil, nil, nil, nil, nil, -- 191
nil, "pause", nil, "home", "up", -- 196
"pageUp", nil, "left", nil, "right", -- 201
nil, "end", "down", "pageDown", "insert", -- 206
"delete" -- 211
}
(Really ? the code tag transforms tabs into spaces, great, sorry for the mess)