Topic was automatically imported from the old Question2Answer platform.
Asked By
CatastrophicDInosaur
I want to make my UI as functional as possible, but when I use the built in focus tool it will automatically make it edit the text as it’s focused on it. Can I make it require a key press to edit the text?
You can set the TextEdit’s readonly property to true until Enter has been pressed while the TextEdit is focused. When Enter is pressed, set readonly to false until the TextEdit loses focus.
However, note that this is not the expected behavior in most applications. In fact, if you try tabbing around form fields in your web browser, you’ll notice that you can start typing text as soon as a text field is focused with Tab.