Trap/script for arrow keys?

Derek Huby derek.huby at ntlworld.com
Fri Mar 7 13:01:55 EST 2003


Monte's script:

on arrowKey tKey
    put the loc of btn "Fish" into tLoc
      switch tKey
        case "left"
           subtract 10 from item 1 of tLoc
          break
        case "right"
        add 10 to item 1 of tLoc
          break
    case "up"
        subtract 10 from item 2 of tLoc
    case "down"
        add 10 to item 2 of tLoc
        break
     end switch
     set the loc of btn "Fish" to tLoc
end arrowKey

.. works beautifully here, except that there's a "break" missing in the "up"
case statement.

Peace,

Derek.




More information about the use-livecode mailing list