On arrowKey issue, changing cards

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
matt
Posts: 18
Joined: Sat Jun 12, 2010 2:40 am

On arrowKey issue, changing cards

Post by matt » Sun Dec 12, 2010 7:52 pm

Hi Everyone, I have a memorizer stack that works great within Rev on my Mac but intermittently causes the card to change unexpectedly when the stack is made into a Windows standalone. I'm using rev 4 still, if that matters. The script is on my main card of my stack and looks like what I've pasted below (I replaced some code with ellipses to shorten this post, but all that does is change the color of the text in the main field, word by word). On Windows, what happens is that the first couple of times I use the left or right arrow, the card will change. Then by the third or fourth press the behaviour will start working as expected on the card's main field to show or hide the text the user is trying to memorize. Thanks for any advice. I'm hoping someone else on the forum has run into this before. -Matt

Code: Select all

on arrowKey the key
case "left"
...
exit switch
case "right" 
...
exit switch
end arrowKey

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Re: On arrowKey issue, changing cards

Post by Janschenkel » Sun Dec 12, 2010 7:54 pm

Check out the documentation for the navigationArrows global property.

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

matt
Posts: 18
Joined: Sat Jun 12, 2010 2:40 am

Re: On arrowKey issue, changing cards

Post by matt » Sun Dec 12, 2010 8:48 pm

Jan, thank you! I should have thought to see whether there was a property involved, but it confused me that everything worked as expected except on Windows. I had gone through some of the early tutorials in which card navigation was tied to buttons and I thought that was always the way Rev handled movement between cards.

Klaus
Posts: 14194
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: On arrowKey issue, changing cards

Post by Klaus » Sun Dec 12, 2010 10:09 pm

Hi Matt,

some general hints, the script should look like this:

Code: Select all

on arrowKey the_key
## No space in parameter names!
  switch the_key
   case "left"
   ...
  BREAK
## Keep correct "switch" syntax, remember Murphys law ;-)
   case "right" 
   ...
  BREAK
  end switch
end arrowKey
8)

Best

Klaus

Post Reply