Since you can convert a string to text, I just changed the functions return type to string, and changed all the returns in the switch to string, hope that helps :)
Well, if you want to get the key and not an integer, you would have to do as Bashar said and create a function with key preset as the parameter with a switch action that will return text depending on the key code of the pressed key. The attached map should be what you want.
The editor has String to Text, but not Text to String.
Since you can convert a string to text, I just changed the functions return type to string, and changed all the returns in the switch to string, hope that helps :)
Well, if you want to get the key and not an integer, you would have to do as Bashar said and create a function with key preset as the parameter with a switch action that will return text depending on the key code of the pressed key. The attached map should be what you want.
Events
UI - Player Any Player presses None key Down with shift Allow, control Allow, alt Allow
Local Variables
keyPressed = (Key Pressed) <Key>
string = (String((Integer(keyPressed)))) <String>
Actions
UI - Display ("The key value is " + (Text(string))) for (All players) to Subtitle area
Is this what you are trying to do?