To retrieve the selected text in a multi-line editbox, you use: $did(dname,ID,1).seltext
To retrieve the current cursor line, you use: $did(dname,ID,1).sel
To retrieve the position of the starting selected character, you use: $did(dname,ID,1).selstart
To retrieve the position of the ending selected character, you use: $did(dname,ID,1).selend
To set it back, you use the form: did -c dname ID [N [StartPos [EndPos]]]
did -c dname ID $did(dname,ID,1).sel $did(dname,ID,1).selstart $did(dname,ID,1).selend
The on *:DIALOG:dname:scroll:ID: event is used in conjunction with vertical or horizontal scroll controls, like you might see used in MP3 players for volume or song position controls. It has nothing to do with the keyboard and nothing to do with the mouse inside an editbox control.