On 31 Mar 2006 23:42:50 +0100, Chris Young wibbled on for an age:

> Now for the next hurdle.  Please can you give me a quick rundown of
> which variables are supposed to be set and to which values for
> keyboard and mouse input.  I gather these are all in the KBD structure
> but there seems to be a few different mouse and keyboard variables and
> I'm not sure what to set.

I've largely got the mouse working with some trial & error.  I'm using
the following code modified from the Windows and X versions:

int HorizPos = (int)VIDC.Horiz_CursorStart - (int)VIDC.Horiz_DisplayStart*2;
int VertPos = (int)VIDC.Vert_CursorStart;
VertPos -= (signed int)VIDC.Vert_DisplayStart;
int xdiff = (msg->MouseX - 20) - HorizPos;
int ydiff = - (msg->MouseY - VertPos);

if (xdiff > 63)
  xdiff=63;
if (xdiff < -63)
  xdiff=-63;

if (ydiff>63)
  ydiff=63;
if (ydiff<-63)
  ydiff=-63;

KBD.MouseXCount = xdiff & 127;
KBD.MouseYCount = ydiff & 127;


msg->MouseX and msg->MouseY are the co-ordinates of the Amiga mouse
pointer - this has an origin of 0,0 at the top left.

If I modify the xdiff and ydiff maximums down to 1, the RISC OS
pointer seems to follow the Amiga pointer correctly, if I move
it in one pixel increments.  However, when the two pointers are
within 1 pixel, the RISC OS one seems to jump one pixel other to the
other side.

This wouldn't be a problem, except when the maximums are increased
back to 63, it still does it but jumps 63 pixels the other side of the
pointer when it gets within 63 pixels!  It appears to affect both X
and Y.

I'm tearing my hair out over this one, and it's probably obvious but I
can't see it - anyone?

Thanks
Chris


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
arcem-devel mailing list
arcem-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/arcem-devel

Reply via email to