46 lines · 1.7 KB · Text
RawDownload
= pointer: mouse and stylus interface     bind -a #m /dev     /dev/cursor    /dev/pointer The  pointer  device  is the interface to input from a mouse,stylus, or some other device for pointing at positions  on  adisplay.  On some platforms, the pointer is associated with acursor on the display,  that  is  displayed  at  the  currentpointer  position.   There  often are buttons associated withthe pointer, whether on the  pointing  device  or  elsewhere.For  instance,  some of the buttons on a PDA might be associ‐ated with the stylus not a keypad, to allow  modification  ofstylus  actions  when  there are are no buttons on the stylusitself.  In the hosted environment of emu(1), the pointer  isassociated with the host system's own pointing device. Reading the pointer file returns the current pointer positionand the state of any buttons  associated  with  the  pointer.The  read  blocks  until the state has changed since the lastread.  Each read returns a 49 byte record:        mx y buttons msec Each record has the letter m  immedlately  followed  by  four11-character  decimal  numbers, each number ended by a blank.X and y give the coordinates of the pointer in display  coor‐dinates;  the  value buttons has bit (1<<b) set when button bis down; and msec is a time stamp in milliseconds. Writing a record of the above form to pointer moves the  dis‐played cursor to the given x and y position; buttons and msecare ignored. Writing an image(6) file to the cursor file sets the image ofthe  cursor  on the display.  Reading cursor returns the cur‐rent cursor image, again in image(6) format. == source/emu/port/devpointer.c/os/port/devpointer.c == see ALSOwm(1), draw-intro(2), image(6)