arrowKey modifier?

Ken Ray kray at sonsothunder.com
Mon Apr 18 02:41:04 EDT 2005


On 4/18/05 1:30 AM, "Erik Hansen" <erikhans08 at yahoo.com> wrote:

> is there a way to modify the arrowkey message?
> to imitate the way arrowKey with shiftKey
> lets you move selected objects
> a greater distance

If I'm reading you correctly, you just trap the message, get the direction
of the arrowkey and process accordingly. So you could do:

on arrowKey pDir
  if the shiftKey is down then put 10 into tIncr
  else put 1 into tIncr
  put the selectedObject into tObj
  if tObj <> "" then
    switch pDir
    case "left"
      set the left of tObj to (the left of tObj - tIncr)
      break
    case "right"
      set the left of tObj to (the left of tObj + tIncr)
      break
    case "up"
      set the top of tObj to (the top of tObj - tIncr)
      break
    case "down"
      set the top of tObj to (the top of tObj + tIncr)
      break
    end switch
  else
    pass arrowkey
  end if
end arrowKey

Is this what you're looking for?

Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com




More information about the use-livecode mailing list