Arrow keys on background list field

duane poncy tsalagi at elohigadugi.org
Tue Dec 28 11:53:17 EST 2004


Thanks guys!  A combination of all three of your 
suggestions did the trick.


On Tue, 28 Dec 2004 07:09:52 -0500 (EST), use-revolution-
request at lists.runrev.com wrote:

> 
> What I think is happening is that, each time a new card comes up, the
> "focus" is no longer on the scroll list field and thus the "arrowKey"
> message is being handled by another object. The solution, I imagine, is to
> insert some script lines somewhere (the card? the stack?) that use Rev's
> "focus", "arrowKey" and "focusedObject" to ensure the scroll list field
> always receives the "arrowKey" message.
> 
> Cheers,
> Nicolas Cueto
> (Japan)


Cubist at aol.com sez:
>    Seems to me that trapping for the "keyDown" message, or perhaps 
> "arrowKey", might be helpful here. Something along these 
> lines should do what you want:
> 
> on keyDown Diskey
>   put the hilitedLine of me into CurrentLine
>   switch DisKey
>   case "left"
>     # if you want the left arrow to behave the same as the up arrow,
>     # remove all the code from this 'fork' of the switch
>     put 1 into NextLine
>     break
>   case "up"
>     # note: i don't recall the precise syntax for the value of "the 
> hilitedLine",
>     # so you may need to tweak the line immediately after this comment
>     put max ((CurrentLine - 1), the number of lines in me) into NextLine
>     break
>   case "right"
>     # see comment for the "left" fork of this switch
>     put the number of lines in me into NextLine
>   case "down"
>     # same caveat as for "up"
>     put min ((CurrentLine + 1), the number of lines in me) into NextLine
>     break
>   default
>     # this fork of the switch covers everything *but* arrow keys.
>     # do as you please with them
>   end switch
> 
>   if CurrentLine = NextLine then
>     # the user is trying to scroll back to before the first line,
>     # or else to scroll past the last line. BAD user!
>     beep 2
>   else
>     # let the user scroll normally
>     set the hilitedline of me to NextLine
>     if DisKey is in "left up" then
>       go prev card
>     else
>       go next card
>     end if
>   end if
> end keyDown
> 
>    That handler has not been tested, but its underlying logic (if not its 
> *syntax*...) should be okay. Hope this helps...
> 


> 
>   set the navigationArrows to false
> 
> That should do it...
> 
> Ken Ray
> Sons of Thunder Software
> Web site: http://www.sonsothunder.com/
> Email: kray at sonsothunder.com
visit elohi gadugi: poetry, software, 
Cherokee culture and Native American rights.
http://elohigadugi.org/

--------------------------------------------------------
Another world is not only possible, she is on her way. 
On a quiet day, I can hear her breathing.  - Arundhati Roy
---------------------------------------------------------



More information about the use-livecode mailing list