Hide the iOS keyboard

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am
Location: Bordeaux, France

Re: Hide the iOS keyboard

Post by Dixie » Thu Jan 26, 2017 3:06 am

If you are writing for mobile then why do you need a cursor ?... and Jean-Marc, the stack I sent you uses locked fields so that the iOS keyboard does not pop-up... You are being a little confusing here about what you actually want to achieve...

dixie

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: Hide the iOS keyboard

Post by jmburnod » Thu Jan 26, 2017 5:33 pm

Hi John,
If you are writing for mobile then why do you need a cursor ?
Because I want the user can watch where the typed letter will be placed.
Jean-Marc
https://alternatic.ch

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: Hide the iOS keyboard

Post by jmburnod » Sat Jan 28, 2017 4:46 pm

Hi,
Here is a new version of "stCustomCursorLockField"

The goal
choosing where we want insert or delete a char in a locked field to use it on ios and avoïd ios keyboard comes. Clic on a btn A or B to put A or B at the insertion point and DEL to delete char before insertion point

News
• Works with physical keyboard except for certains accented letters "`!^¨"
• Delete selection is better than first version (cursor placement was wrong)

To do
• A click after last char or before first char return empty for both. I used mouseh but I think that is not the best way.
Attachments
stCustomCursorLockField001.zip
(5.14 KiB) Downloaded 282 times
https://alternatic.ch

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3990
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Hide the iOS keyboard

Post by bn » Sat Jan 28, 2017 8:00 pm

Bonsoir Jean-Marc,

here is my version of handler defTextMu (only part of handler)

Code: Select all

 if the selectedtext = empty then
      put the selectedChunk into tChunk
      get the mouseCharChunk
      --       •• first char or last char 
      if it = empty then
         put word 4 of tChunk into sMyNumChar
      else
         put word 2 of the mouseCharChunk into sMyNumChar
      end if
      select char sMyNumChar of fld "fText"
      PlaceMyCursor
   else
      put word 2 of the mouseCharChunk into sMyNumChar
   end if
here is my take on handler placeMyCursor

Code: Select all

on placeMyCursor
   put the formattedRect of the selectedText into tFormRect
   select empty
   set the bottomLeft of btn "bMyCursor" to item 3 of tFormRect -1, item 4 of tFormRect
   show btn "bMyCursor" 
   doStartMyHiCursor
end placeMyCursor
The only difference in behavior I could see ist that if you click before line 2 at the left of the field it will now select after line 1.

Kind regards
Bernd

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: Hide the iOS keyboard

Post by jmburnod » Sun Jan 29, 2017 5:09 pm

Salut Bernd,
Thanks for help, it works better now.
Here is a new version with your suggestions and some news features
• A btn "cr" allows to put cr char after the current letter or instead selection
• Works with physical keyboard except for certains accented letters "`!^¨" (solved elsewhere)
Kind regards
Jean-Marc
Attachments
stCustomCursorLockField002.zip
(5.3 KiB) Downloaded 342 times
https://alternatic.ch

j9v6
Posts: 77
Joined: Tue Aug 06, 2019 9:27 am
Location: U.K.
Contact:

Re: Hide the iOS keyboard

Post by j9v6 » Thu Jan 14, 2021 4:57 pm

Hi Guys,

Was there ever a definitive solution to disabling the keyboard on iOS when moving from an input field to a button? I am having the exact same problem as initially described by FireWorx.

I have an iOS card with an editable field "inputField", a button "pickIt" to display a pick-list (mobilepicklist), and a field "pickListChoice" to display the item chosen from the pick-list. This is what I'm finding happens:

1. The iOS keyboard pops up when you tap the editable field. :)

2. If you then tap the button to display the pick-list the keyboard disappears and the pick-list pops up :)

3. Once you've selected the pick-list item, the keyboard pops up again. :(

I've tried various techniques to try to turn the keyboard off, including:

a. focus on nothing

b. 'set lockText of field "InputField" to true' in the button handler - this does lock the field, but the keyboard still pops-up and lets you press buttons on it, but the text doesn't get put anywhere.

I have found that if you enter some text then press the 'Return' button on the iOS keyboard when in the input field, the keyboard does disappear (as I have travelsalOn) and the pickListChoice field receives 'focus' (kinda) ( i have "can receive keyboard focus" set for it). This fixes it partially, but only if the user presses the Return key on iOS.

I've run in to a slight issue with apps jamming when the user quickly jumps from a text input field to a pick list while the keyboard or pick-list animations are in progress on the iOS device - the app can get jammed as it appears that both the keyboard and the mobilepicklist pops up over the pick list but the pick list is the active control.

Thanks,

Al.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7214
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Hide the iOS keyboard

Post by jacque » Fri Jan 15, 2021 6:46 pm

Just a guess, but you could try

Code: Select all

send "focus on nothing" to me in 1 millisecond
at the end of the button handler.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply

Return to “iOS Deployment”