backKey with DataGrid

Dan Friedman dan at
Tue Oct 6 18:19:30 EDT 2020

Here's a weird one...   I have a card with a number of objects on it.  There is a button named "Back" which takes you back to card X.  There is also a dataGrid.  In the mainStack script, I have a this backKey command:

on backKey
  //this is sent only on Android when the user presses the hardware "back" key
  if there is a btn "Back" of this card then
    send "mouseUp" to btn "Back" of this card in 1 tick
  end if
  exit to top
end backKey

When the card opens, and you tap the backKey (on an android device of course), it works great!   Now, if I scroll the dataGrid, the backKey message fails.  If I then tap any other control on the screen (not the dataGrid), then the backKey message works again.  This is true even if the dataGrid has no data (ie.:  set the dgData of grp "myDataGrid" to "").

I have verified that there is only 1 button named "Back" on the entire card (including the template for the dataGrid).

When I say the "backKey" message fails, what really happens is the statement  "if there is a btn "Back" of this card" does result as true, but the sending of the "mouseUp" message isn't sent (or perhaps it's not received).  Also, if I just tap the "Back" button it does go back.

Any ideas?


More information about the use-livecode mailing list