This behavior script can be attached to a field or text member. It will allow the user to use the Home, End, Page Up, and Page Down keys as they were intended when editing a text/field member.
property spriteNum, pSprite, pMem
on beginSprite me
pSprite = sprite(spriteNum)
pMem = pSprite.member
end
on keyDown me
Case the keyCode of
115: -- Home
aChar = pMem.selection
theLocV = pMem.charPosToLoc(aChar[2] + 1)[2]
theChar = pMem.LocToCharPos(point(0, theLocV)) - 1
pMem.selection = [theChar, theChar]