How to dismiss keyboard on mobile

Sannyasin Brahmanathaswami brahma at hindu.org
Tue May 15 22:15:47 EDT 2018


I found a way!

# Set search string field, the 

on returnKey
   delete char -1 of me
   select after word -1 of me # but this does work on android, cursor goes the head of the when hitting return 
end returnKey

# the Search Bottom:

on mouseup
   focus on the mouseControl 
# above key line, which dismissed the keyboard 
# and allows it come up again if the user clicks back in the search string
   put the shortName of me into pTarget
   executeSearch pTarget
end mouseup

# and, just to be sure, executeSearch button.

put (line 1 of tSearchString) into tSearchString

now I never get a CR in search.  keyboard behaves expected! Yay!

Also, Android is NOT the backKey engine when the keyboard is up..

I have this in a lib/back script, will fire any time I used the backKey, but not the keyboard is up.

the whole business about check the effective working screenrect.  the handler never seen it!

on backkey # need for android
    answer "got it" with "ok"
   put the effective working screenrect into tScreen
   if (item 4 of tScreen-item 2 of tScreen) < 650 then
      # assume keyboard if up
      pass backKey
   else 
      if the short name of this stack is "journal" then
         send mouseup to widget "go-back"
      else
         send mouseup to widget "go-home-portal"
      end if
   end if
end backkey








More information about the Use-livecode mailing list