Is there a way to hide the keyboard after the user has not had any activity?
For example, after 10 seconds of not using the keyboard, it closes automatically or hides, or if the user has not touched the touch screen after 10 seconds, the keyboard will be hidden if it is open.
Any way to do it ?. In general I need to detect when a user stops having activity on the keyboard or on the touch screen to activate or deactivate a clock that will be responsible for closing it after 10 seconds or more.
Initialize a variableT to 0, then when text got focus, set timer enable to true. (Interval= 1 second)
Then when text changes, set that variable to 0. This shows that the user is active.
Each time the timer fire,
Do: if variableT = 10 (or the amount you want to)
Then hide keyboard
Else: if variableT is less than 10
The: add 1 to the variableT
I appreciate you sharing your solutions. But I am not using a TextBox, but an HTML text editor. So I would not know yet to detect inactivity in the html text editor. Of course, the first one already gave me an idea to verify if the text has changed, but for her it would be necessary to create an invisible text, where what has been written in the text editor html is stored, and verify if the text, in the label , has changed every 3 or 5 seconds, and so, if it has not changed, activate the clock of 10 seconds or more that will be responsible for hiding the keyboard. But even so, personally, even if it’s a good trick, I can’t imagine running out of memory having two open texts, both written in the html text editor, and the hidden label.
So I think they should implement a block in Kodular that detects user inactivity, such as when no more touch is detected on the screen, such as that the virtual keyboard has not been used.
You can use JavaScript’s setTimeout() function to schedule a change in the WebViewString 10s after keyboard inactivity, capture the event using Kodular’s WebViewString changed block and then hide the keyboard.
Sorry?. I think that “detecting user inactivity” is a very universal and required issue when applying. For two reasons … 1, show ads; 2, close or pause or save some activity that the user was doing and leave open.
So, if people say that I am talking about a “TextBox”, it is not because I have said it, I did not even mention it, but clearly because Kodular is very limited that it seems that the keyboard is only used here to fill in a TEXTBOX. …