Best way to register raw keyboard input with an Event?

Long story short, I’m trying to make a sort of “Typing of The Dead” mini-game for a project I’m in the middle of, and I’m looking for a way to register raw keyboard inputs. More specifically, I’m hoping for some kind of Event that can fire off of any keyboard input, and then I can get that keyboard input, so I can compare it to the current text inside of a text box and then change the color of the text in the textbox.

Gameplay of ToTD as an example: https://youtu.be/SDK88HHndK4?si=FunPe7jy1TZPukoZ&t=626

What would be the best way to read player keyboard inputs as they happen? Is it viable in some way?

Thanks so much to anybody willing to help! :pray:

Bumping this, real quick. Any help would be greatly appreciated! :pray:

Hi there MGRay,

You can use the (legacy input) event Any Key:

You can also create an Input Action (Enhanced Input System) and bind it to ‘Any Key’, this unfortunately does not pass the key that was pressed though, and according to this thread there may be issues with mixing Enhanced Input and legacy:

Referring to the priority and input consumption things in that thread, any key does work (5.4.2) but without the actual key is no good for your purposes anyway.

1 Like

Looks like Any Key will do me good, at the very least it’s the perfect place to start. Thanks so much, this is great! :tada: :tada: :tada:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.