Droid LiveCode App or iPhone App
In a PERFECT world I would like the cursor to be visible in an unlocked field, the soft keyboard to be disabled (or just not visible), and place my own buttons representing the keys on the keyboard to enter text into a field. Is any of this doable?
Right now I'm looking at my next best solution of locking the field, moving the cursor (so to speak) by hiliting (selecting) a character at a time either moving left or right, noting which char is selected and then hitting one of my "keyboard" buttons which replaces the hilited character. For example, if a letter is hilited in my field and I hit the "B" key button, the hilited character gets replaced by the letter "B".
Kludgy but I think I can get this to work. Ideally though I would like to use my own "keyboard" buttons to enter text in an unlocked field and use left/right keys to move the cursor.
Thanks for any ideas you might have.
Emulate mobile keyboard
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 10052
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Emulate mobile keyboard
Emulating OS keyboards well enough to not annoy users deeply accustomed to the one they're used to is very difficult.
What are you looking to do that can't be done with the built-in keyboard?
What are you looking to do that can't be done with the built-in keyboard?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Emulate mobile keyboard
Keyboard: when you create an Android virtual device, select hardware keyboard.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
Re: Emulate mobile keyboard
I have done this in the past.
You need to lock the field which you have noticed will not longer receive the usual field messages. You now have to add custom handlers to the field for example....
you can then create a virtual keyboard with buttons that send messages to the field
You can tweak these to mimic your ideal field behaviour. I can confirm this method works on a real device. You will not be able to use the keyboard in the ide with these fields
You need to lock the field which you have noticed will not longer receive the usual field messages. You now have to add custom handlers to the field for example....
Code: Select all
on virtualKeyDown tKey
-- if there is hilitedText then replace it with the key
if the selectedText is not empty then replace the selectedText of me with empty in me
put tKey after me
end virtualKeyDown
on virtualBackspaceKey
delete char -1 of me
end virtualBackspaceKey
Code: Select all
on mouseUp
-- a button with label "1" will send virtualKeyDown 1 to the field
send "virtualKeyDown" && the label of me to field "xxxxxx"
end mouseUp