CameraScripts errors with "Invalid value for enum KeyCode"

This happens pretty rarely (and I believe it’s from Mac users), but I’m getting the following error occasionally:

[code]Invalid value for enum KeyCode
Players.ArmadilloPetshop.PlayerScripts.CameraScript.RootCamera, line 818 - upvalue OnKeyUp
Players.ArmadilloPetshop.PlayerScripts.CameraScript.RootCamera, line 1047

Invalid value for enum KeyCode
Players.ArmadilloPetshop.PlayerScripts.ControlScript.MasterControl.KeyboardMovement, line 132

Invalid value for enum KeyCode
Players.ArmadilloPetshop.PlayerScripts.CameraScript.RootCamera, line 780 - upvalue OnKeyDown
Players.ArmadilloPetshop.PlayerScripts.CameraScript.RootCamera, line 1023[/code]

Nothing new, has happened to some other (real) CoreScripts before.
It’s because Mac has some keys that don’t have a KeyCode enum.
Internally, instead of using KeyCode.Unknown, it uses nil/null.
The error is easily reproducable in Lua:

Instance.new("Part").FormFactor = nil
--> Invalid value for enum FormFactor

I’m disappointed (but not entirely surprised) they didn’t fix it yet.
They have KeyCode.Unknown, why don’t they use it?

EDIT: Forgot to mention:
This error probably gets thrown when it’s setting the InputObject’s KeyCode.

2 Likes