Getting What Key is Pressed on Keyboard
procryon last edited by
Hey guys I have a simple question. I saw a post on the forum here that was related to this but unfortunately, the only answer on that post did not clarify enough for me. So what I need to ask is this:
Say I ask for a user’s input in a text field, how do I make it so that instead of having to press a button in order for the user’s input to be processed, the user can simply hit “return” on the keyboard.
JonB last edited by
For TextField, which contains a single line, pressing Enter automatically calls the
actionmethod, so the following also works
def a(sender): #called when done entering text print(sender.text ') t=ui.TextField(a) t.action=a t.present('popover')
For TextView, you would instead use one of the delegate methods textview_did_change, or textview_should_change.
Phuket2 last edited by