- Home /
Question by
Bramverhoeven2 · Mar 01, 2021 at 11:06 AM ·
inputkeyboard input
Keyboard.current.onTextInput difference between shortcut or plain text
I am trying to convert our project to the new Input System but running into an issue.
In our project we got a custom made input field where we can use shortcuts (for example CTRL-c) and insert normal text. So I want to detect the difference between a normal c and CTRL-c.
I got the code working to detect CTRL-c with the following
if (Keyboard.current.ctrlKey.wasPressedThisFrame && Keyboard.current.cKey.wasPressedThisFrame)
{...}
but also the Keyboard.current.onTextInput is triggered with a hidden char.
But when I detected a shortcut I want to ignore the input from Keyboard.current.onTextInput. Is there any way to do this with the new input system?
In the previous input system I just got the Input.inputString in the else when there was no shortcut detected
Comment
Your answer
