- Home /
ArgumentException: Input Key named: LeftAlt is unknown
Hi, I made a build so that I could bug test with a couple friends of mine, but I had the developer console enabled so they could tell me when/if they get any errors, but the console is constantly spammed with the message "ArgumentException: Input Key named: LeftAlt is unknown."
The only time the string "LeftAlt" is used in anything that I've coded, is KeyCode.LeftAlt, but nothing else, and this error is NOT shown at all in the editor.
I even created a new input button "LeftAlt" just thinking that might fix it, but it didn't.
Thanks in advance!
Answer by hexagonius · Oct 25, 2016 at 09:13 PM
If you use any Input.GetKey... method in conjunction with KeyCode.LeftAlt then it's probably a Unity Bug and you should file a bug report. At least the docs list this button and if you get your game compiled it's definitely there.
Or is it, that you do compile for a platform not supporting it (Android, iOS...), just a guess.
The platform is PC, and I will consider reporting the bug to Unity, but my project is 3GB.
Answer by Bunny83 · Oct 25, 2016 at 09:58 PM
You most likely used the string "LeftAlt" somewhere. However the string key names have a different contention as the enum members in the KeyCode enum. See the very bottom of this page. The left alt key name is "left alt". You should avoid using string key names whenever possible. If you need to pass a key as parameter to a method you should use the KeyCode enum when possible.
Thank you for your reply, Bunny83.
I already know this, I NEVER use Input.Get$$anonymous$$ey/Down/Up with a string, and as I said, it's only in the build and anything that uses LeftAlt works fine.
Your answer
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
Input system looses keypress after a few frames [BUG?] 0 Answers
Multiplayer Working fine at one place but not other place 2 Answers
Multiple Cars not working 1 Answer
Script work in editor but not in build 0 Answers