Kill Messages
I've written a handler which nudges a selected image when an arrow key is pressed. The problem is if the user holds the arrow key down for a few seconds the messages get backed up. When the user finally lets the arrow key up the object keeps nudging across the screen. I've tried to stop the nudging with the keysDown() function but not having any luck. I need some way to detect there are no keys down and kill any messages which have been backed up. Ray Horsley LinkIt! Software ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Kill Messages
Most times these things can be solved by rethinking, And I say this having no idea what you were thinking. Try this in the card script: on arrowKey var if keysDown() = 65363 then set the loc of btn 1 to item 1 of the loc of img 1 + 1 , item 2 of the loc of img 1 end if end arrowKey Note this can be done with a rawKeyDown handler just as well. Craig Newman -Original Message- From: Ray r...@linkit.com To: use-livecode use-livecode@lists.runrev.com Sent: Thu, Apr 10, 2014 11:41 am Subject: Kill Messages I've written a handler which nudges a selected image when an arrow key is pressed. The problem is if the user holds the arrow key down for a few seconds the messages get backed up. When the user finally lets the arrow key up the object keeps nudging across the screen. I've tried to stop the nudging with the keysDown() function but not having any luck. I need some way to detect there are no keys down and kill any messages which have been backed up. Ray Horsley LinkIt! Software ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Kill Messages
A bit cavalier about doing this with rawKeyDown. It would be a little different, something like: on rawkeydown var if var= 65363 then set the loc of btn 1 to item 1 of the loc of img 1 + 1 , item 2 of the loc of img 1 end if end rawkeydown Craig -Original Message- From: dunbarx dunb...@aol.com To: use-livecode use-livecode@lists.runrev.com Sent: Thu, Apr 10, 2014 12:02 pm Subject: Re: Kill Messages Most times these things can be solved by rethinking, And I say this having no idea what you were thinking. Try this in the card script: on arrowKey var if keysDown() = 65363 then set the loc of btn 1 to item 1 of the loc of img 1 + 1 , item 2 of the loc of img 1 end if end arrowKey Note this can be done with a rawKeyDown handler just as well. Craig Newman -Original Message- From: Ray r...@linkit.com To: use-livecode use-livecode@lists.runrev.com Sent: Thu, Apr 10, 2014 11:41 am Subject: Kill Messages I've written a handler which nudges a selected image when an arrow key is pressed. The problem is if the user holds the arrow key down for a few seconds the messages get backed up. When the user finally lets the arrow key up the object keeps nudging across the screen. I've tried to stop the nudging with the keysDown() function but not having any luck. I need some way to detect there are no keys down and kill any messages which have been backed up. Ray Horsley LinkIt! Software ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Kill Messages
Craig - your simple script works great. The problem I have is because I'm calling other handlers which do things like update a datagrid. Somehow this is what's actually causing the continuation. Thanks for exposing this for me! I think I can probably finesse it from here. On 4/10/2014 12:08 PM, dunb...@aol.com wrote: on rawkeydown var if var= 65363 then set the loc of btn 1 to item 1 of the loc of img 1 + 1 , item 2 of the loc of img 1 end if end rawkeydown ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode