ArrowKey Handler in LiveCode 8?
RM
richmondmathewson at gmail.com
Sat May 7 14:35:08 EDT 2016
NBG: Stack here: http://forums.livecode.com/viewtopic.php?f=6&t=27225
on arrowKey AWK
switch AWK
case "left"
put item 1 of the loc of img "eight" into IT1
put item 2 of the loc of img "eight" into IT2
put (IT1 - 10) into IT1
move img "eight" to IT1, IT2
break
case "right"
put item 1 of the loc of img "eight" into IT1
put item 2 of the loc of img "eight" into IT2
put (IT1 + 10) into IT1
move img "eight" to IT1, IT2
break
case "up"
put item 1 of the loc of img "eight" into IT1
put item 2 of the loc of img "eight" into IT2
put (IT2 - 10) into IT1
move img "eight" to IT1, IT2
break
case "down"
put item 1 of the loc of img "eight" into IT1
put item 2 of the loc of img "eight" into IT2
put (IT2 + 10) into IT1
move img "eight" to IT1, IT2
break
end switch
end arrowKey
Richmond.
On 7.05.2016 01:07, JOHN PATTEN wrote:
> Hi All,
>
> I was going to use the arrow keys to move an object, something like what Devin wrote up a while ago:
>
> on arrowKey pWhich
> # determine some way to designate which object is to be nudged
> put the long id of btn "test" into tSelObj # for example
> switch pWhich
> case "left"
> put -1 into tXamount
> put 0 into tYamount
> break
> case "up"
> put 0 into tXamount
> put -1 into tYamount
> break
> case "right"
> put 1 into tXamount
> put 0 into tYamount
> break
> case "down"
> put 0 into tXamount
> put 1 into tYamount
> break
> end switch
> move tSelObj relative tXamount,tYamount
> end arrowKey
> and after a few tests in LiveCode 8, I cant get anything to budge with the arrowkeys? I opened the same stack in LiveCode 7.06 and it works fine. Something change or is this a bug in 8?
>
> Thank you!
> _______________________________________________
> 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
More information about the use-livecode
mailing list