Tab between fields on mobile device

Mike Kerner MikeKerner at roadrunner.com
Thu Nov 1 10:13:43 EDT 2018


Instead of using tab we use enterkey, that way both hardware and on-screen
keyboards work.

On Thu, Nov 1, 2018 at 9:42 AM Andrew Bell via use-livecode <
use-livecode at lists.runrev.com> wrote:

> I'm trying to tab from field to field in a mobile app when pressing
> the TAB key on a bluetooth keyboard, but having no luck in an iOS app.
> My "on tabKey" code works fine in the IDE but not on the iPad.
>
> After closer inspection of the dictionary, I discovered that the
> tabKey handler is NOT supported by iOS. My attempt to use keyDown
> instead is thwarted because according to that dictionary entry: "If
> the key pressed is the Return, Tab, Backspace, Delete, or Enter key,
> an arrow key, or a function key, no keyDown message is sent. Instead,
> the returnKey, tabKey, backspaceKey, deleteKey, enterKey, arrowKey, or
> functionKey message is sent."
>
> This led me to try rawKeyDown. When running in IDE this gives me a
> proper key code (65289) but when running in iOS I'm returned a zero.
>
> on rawKeyDown tKeyName
>     ## THIS ATTEMPTS TO MAKE THE tabKey CODE MOBILE FRIENDLY
>     if tKeyName = 0 or tKeyName = 65289 then
>        tabKey
>     else
>        pass rawKeyDown
>     end if
> end rawKeyDown
>
> The code I hacked together will force a tab for a number of other
> special characters (from quick tests, almost every key combo of ALT
> and any other key returns 0 as well). I don't need to be too flexible
> (this is an in-house product only running on 1 specific model of iPad
> Pro) but am curious if there is a better way to approach this.
>
> --Andrew Bell
>
>
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>


-- 
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."



More information about the use-livecode mailing list