Mysterious Extra KeyUp Event (5.3.3f1)
Newbie here trying to figure out TextUI elements + scripting. I decided to do so by making a simple text editor by capturing KeyUp events on a TextUI. What I've found is that on every single strike of a key, I'm getting a second event with a 'None' KeyCode.
Here is my script:
Here is sample Debug console:
What is this second event that always fires? Why is it of KeyCode None?
Answer by frederick_otus · Nov 03, 2016 at 02:19 PM
Figured it out. There are separate events fired for characters and keycodes.
Code:
Log:
On a single press of 'a': I fired one event with a KeyCode of A and a character of ' ' and a KeyCode of None and a character of 'a'.
Answer by Cynikal · Nov 03, 2016 at 02:21 PM
http://answers.unity3d.com/questions/666996/why-does-pressing-a-key-generate-a-keydown-event-w.html
Give that a look.
Your answer
Follow this Question
Related Questions
Accessing UI text 0 Answers
How do you change UI Text to an int? 4 Answers
NullReferenceException on Text element 1 Answer
Tooltip doesn't work 0 Answers
Code to replace the count commands in C# for text. 0 Answers