qdosmsq:traps:trap_3:pixq

SD_PXENQ/IOW_PIXQ & SD_CHENQ/IOW_CHRQ

These traps return the window size and cursor position.

TrapValue of D0.BAction
SD_PXENQ/IOW_PIXQ$0ACursor position in pixel coordinates
SD_CHENQ/IOW_CHRQ$0BCursor position in character coordinates
Call ParametersReturn Parameters
D0.BSee aboveD0.LError return.
D1.L D1.LCorrupted.
D3.WTimeout D3.LPreserved.
A0.LChannel ID A0.LPreserved.
A1.LAddress of enquiry blockA1.LCorrupted.
ERR_NCNot complete.
ERR_NOChannel not open.
  • All registers not shown above are not used on entry and are preserved on exit.
  • A1.L must point to a four word block which will contain:
    • X-size of window
    • Y-size of window
    • X-position of cursor
    • Y-position of cursor
  • A pending newline is activated by this trap.

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
  • qdosmsq/traps/trap_3/pixq.txt
  • Last modified: 2009/05/17 15:53
  • by george.gwilt