These traps return the window size and cursor position.
Trap | Value of D0.B | Action |
SD_PXENQ/IOW_PIXQ | $0A | Cursor position in pixel coordinates |
SD_CHENQ/IOW_CHRQ | $0B | Cursor position in character coordinates |
Call Parameters | Return Parameters |
D0.B | See above | D0.L | Error return. |
D1.L | | D1.L | Corrupted. |
D3.W | Timeout | D3.L | Preserved. |
A0.L | Channel ID | A0.L | Preserved. |
A1.L | Address of enquiry block | A1.L | Corrupted. |
ERR_NC | Not complete. |
ERR_NO | Channel not open. |
The example below shows the use of this trap call to find the window size and the position of the cursor in pixel coordinates. It is assumed that A0 contains the window's ID.
enq moveq #sd_pxenq,d0 ; $0A
moveq #-1,d3 ; Timeout
lea ans,a1 ; Address of answer block
trap #3 ; Get the information
tst.l d0 ; OK? . .
bne error ; . . no!
ans ds.w 4 ; Space for the answer