2
$\begingroup$

I'm building some text editor tools. I would like to have live access to a string property as it's being typed. I can assign an update function within a string property but it only updates after the user has pressed enter. I want a way for the update function to run with every key press. Legit ways to do this? Hacks?

$\endgroup$
2
$\begingroup$

There is an option for this. Create the StringProperty with options={'TEXTEDIT_UPDATE'}:

prop = StringProperty(name="Test", options={'TEXTEDIT_UPDATE'})

https://docs.blender.org/api/2.79/bpy.props.html#bpy.props.StringProperty

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.