mazzapaoloitaly at gmail.com
Tue Dec 20 06:13:24 EST 2011
Thank you Mike,
I was able to use your script.
I realize that getting the arrows key is not as trivial as "get the
mouse" or "get the optionKey".
However your script works fine.
Thanks a lot
On Mon, Dec 19, 2011 at 5:28 PM, Mike Bonner <bonnmike at gmail.com> wrote:
> I'm sure this doesn't cover every possibility but will something like the
> following work?
> -- in the card I put
> on arrowKey pKey
> set the cKeyDown of this stack to pKey
> pass arrowKey
> end arrowKey
> on rawKeyUp pKey
> if pKey is among the items of "65361,65362,65363,65364" then
> if the cKeyDown of this stack is not empty then set the cKeyDown of
> this stack to empty
> end if
> pass rawKeyUp
> end rawKeyUp
> --And in a button I put
> local tRunning
> on mouseUp
> if tRunning is empty then put false into tRunning
> put not tRunning into tRunning
> end mouseUp
> command checkArrow
> if tRunning then
> switch (the cKeyDown of this stack is empty)
> case false
> put the cKeyDown of this stack
> case true
> put "No Key is down"
> end switch
> send checkArrow to me in 10 milliseconds
> end if
> end checkArrow
> Depending on your needs this might be enough. It doesn't handle 2 arrow
> keys being pressed (shouldn't be too bad to modify it so that you can
> handle multiple arrow presses, instead of just checking against ALL arrow
> keycodes could have a property for each direction keycode and only wipe out
> the specific arrow key that is released)
> To test, set up the stack as described, click the button to start the
> monitoring and then hit your keys. Should show results in the msg box.
> On Mon, Dec 19, 2011 at 7:51 AM, paolo mazza <mazzapaoloitaly at gmail.com>wrote:
>> Hi All,
>> how can I check if the "arrowKey up" is down or is up ?
>> For example, for the option Key I can write .. if the optioKey is down
>> then..., for the mouse I can write ... if the mouse is down then ...
>> What about the arrow keys ?
>> All the best
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
More information about the Use-livecode