Hi, I have the following scenario:
I have an ingame console that I open with the KeyCode.Backtick key. This key, on a German keyboard, is associated with the Circumflex symbol (^). This is treated as a dead key, meaning that it waits for the next key input. So if I type e.g. an “a” after pressing this button, the actual outcome is “â”.
So that means in my case, if I open the console, the first letter I type will have a circumflex above it. An obvious fix would of course be to just remove the circumflex from the first typed letter if it has one, but I was wondering if there is any cleaner solution.
This is just a guess, I have not tested this, but maybe somehow simulating an ESC press would “cancel” the ^? Or rather it would tell the OS that you are really trying to press the ^ character and stop if from applying to any following characters.
Doing some additional research, another approach could be to consume the ^ press event by using Event.current.Use()
on the frame that ^ was pressed.
Please give it a shot and let me know the results