altkey() down, up & halfway down
Scott Rossi
scott at tactilemedia.com
Sun Dec 2 04:21:16 EST 2012
If you are using alt as a modifier:
on rawKeyDown
if altKey() = down then
-- do some stuff
end if
end rawKeyDown
If you just want to detect the alt key, one option could be to use the
idle message which essentially acts as a loop:
[ card or stack script ]
on idle
if altKey() = down then -- do some stuff
end if
pass idle
end idle
Regards,
Scott Rossi
Creative Director
Tactile Media, UX Design
On 12/2/12 12:00 AM, "Richmond" <richmondmathewson at gmail.com> wrote:
>Advice from Andre Garzia:
>
>"I have no problem with that and I use it here as well. Just do a visual
>feedback like this:
>on rawKeydown, check for the altKey and change all the labels of the
>buttons for the
>actions they will perform if that key is down, this way, as soon as
>someone presses ALT,
>the labels change and they know what is happening."
>
>which makes 100% sense, but I really don't know HOW on a Macintosh:
>
>On a Macintosh "on rawKeydown, check for the altKey" means 'check that
>the altKey is down as I press another key', so
>any label changing on buttons is going to happen AFTER THE FACT rather
>than BEFORE, which misses the point.
>
>"as soon as someone presses ALT, the labels change"
>
>would be lovely, and can be lovely on Windows or Linux, but cannot on
>Macintosh as
>far as I can see.
>
>Richmond.
>
>_______________________________________________
>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