Android Question forcedone use

drgottjr

Expert
Licensed User
Longtime User
can setting forcedone = true be used in lieu of trying to trap the return (enter) key? if so, what's the event that tells me the key has been pressed? let's say the user keys something into an edittext and then has to press a "go" button to trigger something. forcedone just hides the keyboard, but the user still has to press the button.
i see apps where pressing a key 1) hides the keyboard and 2) triggers the button event. the chrome browser would be an example of this behavior, but i see other apps acting the same way. they're responding as if the enter key has been trapped, which, if i understood a post in the forum, we can't do.

i can call button_click programatically, of course, but how do i know the user has pressed the "done" button? losing focus doesn't mean the user is "done", i don't see where action.DONE is handled, and i don't see a suitable keycode in android's list of keycodes. thanks in advance.
-go
 

stevel05

Expert
Licensed User
Longtime User
EditText's raise the event EventName_EnterPressed when the enter key (Done or Finished on my current device) or Next is pressed, which you can trap in B4a with the appropriate sub. If there is more than 1 EditText then all except the last in the order will display Next instead of Finished. ForceDone causes Finished to be displayed on the EditText, When pressed, the EnterPressed event is raised, the soft keyboard is closed and focus is not passed to the next EditText.
 
Last edited:
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
just like it says. thanks.
 
Upvote 0
Top