EventAnyKey returning the key would be handy.
It would also be handy for Press Any Key To Continue cases.
In the meantime, I’ve attached a pasteable set of common key presses [[see the second answer for the textfile]].
Your bool Is shift is a good idea…
To set this up using the pasted data, you may need to create a bool var UserTyping first.
And you’ll need to create events for Enter, BackSpace, Spacebar, Escape but that is pretty easy. Enter sets UserTyping off, and assigns the typed string to another named LastCompletedString for later use. Backspace just needs to get a substring of the typed string (Len-1) and if the result isn’t nothing, updates the string.
(You can add hold+backspace to delete multiple characters if you want). Spacebar just appends a space in the current string.
NB: Some keys are set to do stuff in the game by the engine (for instance F1 is show wireframe).
From each of the key events pasted from the text file, call a function named something like Typing which does the input string append, something like in the image. I have HUD hookups in mine to actually display the string result using DrawText (the int switcher helps in the HUD to toggle between typing states).
thank you for setting up all those events and sharing them.
if you paste code in, and it doesn’t recognize the variables, you can just right click on each variable and it gives you an option to create variable ‘varName’. this makes it easy to copy stuff between blueprints. ( although it will give you error warnings inside the text file if you copy the nodes that were pasted before creating the variables, and those error warnings wont go away unless you paste variables in after the variables already exist, so its good to paste in, create all the variables, delete everything, then paste it in again to get rid of the hidden warnings. )
i have been looking through the C++ source code, and so far i found that the keys are stored in a tMap called KeyStateMap that blueprint does not have access to. but you could make an accessor function for playercontroller that iterates through the map to grab all of the currently pressed keys, and put them into an array of strings.
there is a FlushPressedKeys() function inside playerInput.cpp that iterates through the map of keys, so it could be a good example to start from, but for now, this blueprint method works pretty well.
I added the ability to rapidly delete, where you hold delete or backspace and after a short delay, it begins deleting quickly. i used a timeline with a looping event track that fires every 0.05 seconds. I also added a blinking cursor at the end like a text editor, and I hooked up all the numPad keys.