Field Keyboard Functions

FMoyer at aol.com FMoyer at aol.com
Thu Dec 5 14:46:01 EST 2002


I want to port from Hypercard to Metacard a set of easy keyboard shortcuts to 
move the cursor around and select text in a field. They require the left hand 
to press combinations of shift, ctrl and option (note: I use a Mac) and the 
right hand to press "H", "J","K","L",";" or "I".

Some scripts are working fine, but others aren't. For example, I cannot trap 
ctrl-option-J. In fact, when I press ctrl-option-J, the text at the end of 
the line that I'm on disappears and some hidden something-or-other(?) is 
added to the end of the field. If I press ctrl-option-J or similar (ctrl-J, 
shift-ctrl-J, shift-ctrl-option-j) over and over, the computer crashes. 

My script is:

on controlkeydown what
  put the shiftkey into s
  put the optionkey into o
  if what is in "HJKLI:;" then
    case "J"
      if s is down then
        if o is down then
          -- script to select text back a word
        else
          -- script to move cursor back a word
        end if
      else
        if o is down then
          -- script to select text back a character
        else
          -- script to move cursor back a character
        end if    
      end if
      break
    case "K"
etc.

Any ideas what might be going wrong?

And if any intrepid souls want to test it: try pressing over and over a 
random combination of: ctrl-j, ctrl-option-j, shift-ctrl-j, 
shift-ctrl-option-j. Does your computer crash? Or is it just my computer? I'm 
using OS9. It crashes when I'm running either version 2.4.3 or version 2.5A8.

Thanks.
Fred Moyer



More information about the metacard mailing list