Download

How to check which key is pressed on Any Key Pressed event

Hi, I’m currently creating a virtual keyboard which reflects the input of real-life keyboard, and as it would be painful to create all QWERTY key assets individually I just made a single Key asset with Text variable KeyName, of which blueprint does “if KeyGetDisplayName == KeyName do somethingsomething”, and modified KeyName Text values for each key on the scene (for example, “E” key on the scene would have KeyName = “E” and will react when I press “E” on my laptop keyboard). This works perfectly fine.
However the problem is that KeyGetDisplayName, somewhat expectedly, seems to give out different results on different language versions of UE4. I’m using Korean version of UE4, and pressing Semicolon key returns KeyGetDisplayName value “세미콜론” instead of “Semicolon”. I’m trying to add modding support for my game, and I don’t want those modding this asset to need learning Korean, and doing “if KeyGetDisplayName == “세미콜론” || KeyGetDisplayName == “Semicolon” || KeyGet…” in blueprint for every languages supported by UE4 would be super hard.
Is there any way to make KeyGetDisplayName work regardless of UE4 language settings? What I’d appreciate even more is, is there a way to do this without using KeyGetDisplayName? Thanks in advance.