- Home /
UI.InputField: Using Alt + Arrowkey to make cursor jump to next whitespace
When using the UI.InputField-component, the Arrowkeys moves the cursor. If holding down Cmd (on macOS) + Arrowkey the cursor jumps to the next whitespace.
Is it possible to configure the UI.InputField-component to not do this, when Cmd (on macOS) + Arrowkey is pressed, but instead when Alt (on macOS) + Arrowkey is pressed?
Thanks in advance! :)
This is more related to Operating System than to Unity, look if there are setting in $$anonymous$$acOS for that matter.
The UI.Text component is an unselectable, static label-like UI element. I think you mean UI.InputField?
Unfortunately, there doesn't seem to be any information about how to override default input handling within an InputField
. You probably need to write a custom component that activates when the InputField
is selected, captures keyboard input, and modifies the InputField.caretPosition
manually. Capturing the input might be the easiest with somehow hooking into InputField.ProcessEvent()
, but I'm not sure if that is possible.
Thanks a lot for the answers! I updated the question to clarify that it's about the InputField - I will look into your suggestion Harinezumi...
Your answer
![](https://koobas.hobune.stream/wayback/20220612174208im_/https://answers.unity.com/themes/thub/images/avi.jpg)