mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-14 09:46:53 -04:00
Fixed keyboard.isKeyDown
for chars (strings), making use of the utf8 lib when available (Lua 5.3). Closes #1214.
Thanks to @bawr for pointing out the bug in the first place.
This commit is contained in:
parent
d37e42258e
commit
b0dc3a2d84
@ -159,7 +159,7 @@ end
|
||||
function keyboard.isKeyDown(charOrCode)
|
||||
checkArg(1, charOrCode, "string", "number")
|
||||
if type(charOrCode) == "string" then
|
||||
return keyboard.pressedChars[charOrCode]
|
||||
return keyboard.pressedChars[utf8 and utf8.codepoint(charOrCode) or charOrCode:byte()]
|
||||
elseif type(charOrCode) == "number" then
|
||||
return keyboard.pressedCodes[charOrCode]
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user