Newbie question

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9669
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Newbie question

Post by dunbarx » Fri Aug 18, 2017 2:47 pm

I actually have an app for mobile in development. It works fine on desktop. It requires a minimal (26 letters and "?") keyboard.

Of course, the desktop version already has a keyboard, because the computer has one. My question is this: do I "draw" one with an array of buttons, or is there a "standard" gadget that must be included as a whole as a necessary feature of a mobile app?

I have Colin's book about developing for mobile, but not at hand.

Craig Newman

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Newbie question

Post by Klaus » Fri Aug 18, 2017 7:30 pm

Hi Craig,

mobile devices have a build-in onscreen keaboard that will popup "on openfield".
Or do I misunderstand you?

If you want to roll your own, use a group of btns and do NOT "open" the fields.
Don't you own any mobile device and/or never used it for any text entry? :D


Best

Klaus

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

Re: Newbie question

Post by jmburnod » Fri Aug 18, 2017 8:00 pm

Hi Craig,
I made one screen keyboard for my apps because I want that the user can use it with only one input and it seems no possible to have a control over iOS keyboard and make easier typing an accented letters (some of my students are not able to use a mouse or/and pointing with finger.
I think that would be useful to have a LC keyboard except if there is a way to parameter iOS keyboard (in your case set the visible of btn how we want.
As Klaus said, you have to use a field transversalon = false to avoid popup iOS keyboard
I work on a custom insertion point to allows selection on field with traversalon = false in this topic
viewtopic.php?f=49&t=10514&hilit=keyboard&start=15
Best
Jean-Marc
https://alternatic.ch

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

Re: Newbie question

Post by jacque » Fri Aug 18, 2017 9:00 pm

Every mobile device has a built-in keyboard, and on Android (and now iOS finally) users can install any number of third party keyboards. You can always depend on the device having its own. I wouldn't bother writing a keyboard unless you have very specific needs. There's also the fact that LC on mobile does not support copy/paste and the only way to allow text editing on mobile is to use the built-in keyboard.

I do have to ask whether you have a mobile device to test on. There's no way you can write a mobile app without one (and ideally several.) Mobile devices have their own set of rules and restrictions, and sometimes the differences even vary among devices. Also you are going to have to bite the bullet and use LC 8 or 9. If you don't, you're asking for trouble. Many issues have ben resolved since LC 6.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

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

Re: Newbie question

Post by jmburnod » Fri Aug 18, 2017 11:31 pm

Hi Jacqueline,
I wouldn't bother writing a keyboard unless you have very specific needs
Yes, this is the case. The keyboard I did is only for english and french, qwerty, qwertz and azerty and i think iOS keyboard can use others langages. Not sure i have the energy for chinese or arabic keyboard. :D
There's also the fact that LC on mobile does not support copy/paste and the only way to allow text editing on mobile is to use the built-in keyboard.
Yes, if you use native fields, but it is possible allows text editing with no-native field and copy/paste with mobilepick menu .
I do have to ask whether you have a mobile device to test on
Yes. An iPad with iOS 10.3.
Best regards
Jean-Marc
P.S: 815 this "Klondike morning"
Last edited by jmburnod on Sat Aug 19, 2017 9:02 am, edited 1 time in total.
https://alternatic.ch

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9669
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Newbie question

Post by dunbarx » Sat Aug 19, 2017 12:23 am

Thank you all.

I know about the "native" keyboard, but I want a custom one. 27 chars.

But I never asked about fields. So I assume that you are speaking about editable fields, that these would trigger the opening of the native keyboard. But then why could I not simply place a "dead" openField handler in such fields? I know that mobile has its own world of issues, but surely the LC message path works the same?

Anyway, I can easily rework to that I have no editable fields at all. If I have that right.

Anyway again, I do have an iPhone, but am surprised to learn that in order to simulate the app I needed one. I did measure the screen dimensions and resized my app to fit. But is this laughably ignorant of me? I have read the travails about resolution and rects of the various devices.

@Jacque, I will indeed migrate this to v.8. At the last minute :wink:

Craig

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

Re: Newbie question

Post by jacque » Sat Aug 19, 2017 3:43 am

could I not simply place a "dead" openField handler in such fields? I know that mobile has its own world of issues, but surely the LC message path works the same?
You'll have to double-check but I think the keyboard display happens before the openField is sent.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9669
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Newbie question

Post by dunbarx » Sun Aug 20, 2017 4:34 am

Jacque,
I think the keyboard display happens before the openField is sent.
Well then what does "openField" actually do? This is not what Klaus mentioned, that:
mobile devices have a build-in onscreen keaboard that will popup "on openfield".
But in any case, surely an LC message of some kind is sent, no? Or does the mobile environment have its own message generating system?

I need exactly the following, and all showing at the same time.

26 letters, ten digits, the question mark, a backspace key and an "enter" button. In other words, custom.

I have been following, over years, the travails required to get a mobile app running, never mind published, but I never thought that at the most basic level, the familiar LC paradigm was either usurped, or worse, bypassed entirely. I am not shocked that I will have to adapt to the very special mobile environment, but would hate to think that what I already know and rely upon may be irrelevant. It was so straightforward to build the app on desktop. It sounds like I should have developed in an iOS simulator instead, jut so I could see what works and what does not as the process went forward.

Craig

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

Re: Newbie question

Post by jmburnod » Sun Aug 20, 2017 12:58 pm

Hi Craig,
As Klaus said, you have to use a field transversalon = false to avoid popup iOS keyboard
I was wrong : :oops: field transversalon = true and lock text = true to avoid display iOS keyboard

Did you see this simple stack ?
download/file.php?id=7510
Best
Jean-Marc
https://alternatic.ch

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9669
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Newbie question

Post by dunbarx » Sun Aug 20, 2017 2:44 pm

Jean-Marc.

I could not use the link, and pasting it into a browser failed. There must be a typo.

Anyway, I am so happy that I can disable the standard keyboard and use my own, as you had mentioned early on. I will check out the thread you posted as well.

Forward....

Craig

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

Re: Newbie question

Post by jacque » Sun Aug 20, 2017 4:00 pm

@Craig: Don't worry, the message hierarchy is the same. I can't test right now but I believe the keyboard is activated when the field is focused and after that the openField message is sent. You will get a keyboardActivated message when it appears.

Since this only happens with editable fields, locking the field prevents the behavior, as mentioned.

If you type "mobile" into the dictionary you'll see most of the relevant mobile commands and functions. Some are different from their desktop equivalents, such as the sound commands.

You'll probably have to deal with variable device sizes too. That's another story.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9669
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Newbie question

Post by dunbarx » Sun Aug 20, 2017 5:30 pm

Jacque.

Slowly getting this. Thanks for sticking with me.

So if I wanted to allow traversalOn in an editable field and still never see the native keyboard, couldn't I (pseudo):

Code: Select all

lock screen
click in an editable field
hide the native keyboard that appears as a matter of course
unlock screen
useMyOwnKeyboard
On desktop, with a button and two fields, in the button script:

Code: Select all

on mouseUp
   lock screen
   show fld 2 --ON MOBILE :the native keyboards is shown by the OS
   select text of fld 1
   hide fld 2 --ON MOBILE: hide the native keyboard by command
   unlock screen
end mouseUp
This does not disturb the blinking cursor, and field 2 (the keyboard) is never seen. I am hoping that there is a command "hide native keyboard". There is indeed a message (keyBoardDeactivated) telling me that the keyboard was just hidden. Just a thought.

Craig

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

Re: Newbie question

Post by jacque » Sun Aug 20, 2017 5:58 pm

There are no commands to show or hide the mobile keyboard, it is automatic behavior based on the editability of the field. You can remove the keyboard by removing focus from the field, but that defeats the purpose. Turn on locktext to avoid the keyboard. You can still have traversalon set.

Mobile behavior does not /cannot perfectly mimic desktop behavior. You do need to test at least on the simulator to see what happens.

Note that regardless of how you set up the LC field, there will be no copy or paste ability. I don't know if that is important for your app.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

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

Re: Newbie question

Post by jmburnod » Sun Aug 20, 2017 6:04 pm

Craig,
I am hoping that there is a command "hide native keyboard"
"focus on nothing" is the only way i know to avoid native keyboard
Unfortunately a click in one unlocked fld dysplays native keyboard.
https://alternatic.ch

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9669
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Newbie question

Post by dunbarx » Sun Aug 20, 2017 8:42 pm

Jacque, Jean-Marc.

Thanks.

Just so I am clear, if that ever is possible, I can use my custom keyboard to enter text into a locked field and avoid opening the native keyboard. And my backSpace key will be able to delete the last char of such a field, again, under the radar.

I never need copy/paste.

I understand that I need to start running this in emulation. That means getting xCode, correct? And to do that I have to register with Apple, correct? I will read Colin's book as soon as I get home.

Craig

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”