Page 1 of 2
Hide the iOS keyboard
Posted: Mon Dec 26, 2011 7:32 pm
by FireWorx
Hi,
I set up a user input field in iOS and have a button that takes care gathering the input and taking care of business. Hitting the return key does the same and then hides the keyboard. My question is what code takes care of hiding the keyboard if the user chooses my button rather than the return key on the keyboard?
Thanks,
Dave
Re: Hide the iOS keyboard
Posted: Mon Dec 26, 2011 9:14 pm
by Dixie
Dave...
put
Code: Select all
on mouseUp
focus on nothing
end mouseUp
in the script of your button... the keyboard will be deactivated
be well
Dixie
Re: Hide the iOS keyboard
Posted: Wed Dec 28, 2011 2:09 am
by FireWorx
Wow... Like deep meditation. Focus on nothing. Like it. Thanks!
Re: Hide the iOS keyboard
Posted: Wed Jan 18, 2017 12:06 pm
by jmburnod
Hi All,
Is there a way to hide the ios keyboard definitively because I use a custom keyboard with accentued letters which can be with blue2 switch (one or two input) ?
I played with" focus on nothing" but keyboard is shown when i click on a field
with traversalon = true.
From the doc I understand that keyboardActivated is sent to the card AFTER keyboard is shown.
I thought a type "none" for mobileSetKeyboardType, but not.
Best regards
Jean-Marc
Re: Hide the iOS keyboard
Posted: Sun Jan 22, 2017 10:32 am
by [-hh]
Did you already try to handle things in "focusIn"?
Just an idea.
Re: Hide the iOS keyboard
Posted: Sun Jan 22, 2017 11:18 am
by jmburnod
Guten Tag Hermann,
Thanks
Did you already try to handle things in "focusIn"?
No. It seems that openfield is sent instead focusin when the target field is unlocked.
I will try a lockmessages at openfield
All the best
Jean-Marc
Re: Hide the iOS keyboard
Posted: Sun Jan 22, 2017 12:22 pm
by jmburnod
I tried lockmessages at open field but nothing change, (iOS keyboard comes).
Re: Hide the iOS keyboard
Posted: Sun Jan 22, 2017 2:39 pm
by Dixie
Hi Jean-Marc...
You mention that you wish to use your own custom keyboard... I have sent you a stack that just uses two fields... a very poor 'custom' keyboard, that I guess if you grouped the buttons, you could slide it up and down..

.. but with the use of two behavious ( I have left the behaviour buttons visible for you to see the script... it acts more or less like a keyboard... the behaviours are set up in the card script...
It might work for you
Dixie..

Re: Hide the iOS keyboard
Posted: Sun Jan 22, 2017 3:07 pm
by [-hh]
Hi Jean-Marc and John.
That's a nice trick, 'dixie'.
I avoided mobile until now, but my childs started to 'force' me to build some apps for them. So I tried here to achieve a not-popup of the keyboard when starting to edit a field. And it works here (in the simulator) by simply catching the openField, the keyboard doesn't pop up.
Code: Select all
on openField
-- do nothing and don't pass
end openField
Am I wrong with that beginner's approach?
H.
Re: Hide the iOS keyboard
Posted: Sun Jan 22, 2017 3:13 pm
by Dixie
Hermann...
Are you wrong with your approach ?... I don't know, It did not occur to me !...
Dixie
Re: Hide the iOS keyboard
Posted: Sun Jan 22, 2017 3:27 pm
by Dixie
Jean-Marc..
I just had a thought that you could also popUp an overlay on a letter.. say, by using 'a mouseStillDown' handler on a button 'E', you could then show more 'E's' with the accents on them... just like the regular iOS keyboard does..

Re: Hide the iOS keyboard
Posted: Sun Jan 22, 2017 5:15 pm
by jmburnod
just like the regular iOS keyboard does..
Yes, I did one because that is what I want avoid.
I choosed to make a line of the keyboard with accented letters. First line of keyboard is used for accented letters, ponctuation and numeric keyboard.
The keyboard can be use with the mouse and with a switch with 2 inputs NextObject and ClickCurObject.
I also want put the letter into the selectedchunk and not just after last char.
This stack does words prediction while the user write.
Once I cleaned the stack I post it.
Fld script
Code: Select all
on selectionChanged
doMajStartEndW
end selectionChanged
on openfield
-- set the lockmessages to true --avoid ios keyboard doesn't work
doMajStartEndW
--set the lockmessages to false
end openfield
on closefield
doMajStartEndW
end closefield
on exitfield
doMajStartEndW
end exitfield
on textChanged
-- set the lockmessages to true --avoid ios keyboard doesn't work
defTextTC --•• prediction words
--set the lockmessages to false
end textChanged
on mouseleave
doMajStartEndW
end mouseleave
Cd script
Code: Select all
local sStartCurWord,sEndCurWord
--store selected chunk in locals sStartCurWord sEndCurWord
on doMajStartEndW
if char-1 of the selectedfield <> the num of fld "fText" then
exit doMajStartEndW
else
get the selectedchunk
put word 2 of it into sStartCurWord
put word 4 of it into sEndCurWord
end if
end doMajStartEndW
on defTextTC
--••prediction words
defTextTC
Re: Hide the iOS keyboard
Posted: Sun Jan 22, 2017 7:43 pm
by jmburnod
I tested on device with just this script fld
The iOS keyboard comes.
Jean-Marc
Re: Hide the iOS keyboard
Posted: Tue Jan 24, 2017 11:28 pm
by jmburnod
@ John,
Here is a keyboard with custom cursor I used. It work on iOS except the keyboard which comes at each open field
http://forums.livecode.com/viewtopic.php?f=8&t=28073
I work for a new version for one bluetooth switch with two inputs
Kind regards
Jean-Marc
Re: Hide the iOS keyboard
Posted: Wed Jan 25, 2017 11:08 pm
by jmburnod
I maybe found a way to use a locked field like an unlocked field to avoid iOS keyboard.
I use a btn as custom cursor.
That was a sweet surprise that it seems work, iOS keyboard doesn't appear
