Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

[MBS] get Global Coordinates (LocalToGlobal) (MBS Xojo Plugin Mailinglist archive)

Back to the thread list
Previous thread: [MBS] Language support?
Next thread: [MBS] DVD Playback works :-)


Re: [MBS] MIDI Destinations and External Devices   -   Ron Benditt
  [MBS] get Global Coordinates (LocalToGlobal)   -   Brian Rathbone
   Re: [MBS] get Global Coordinates (LocalToGlobal)   -   Christian Schmitz
    Re: [MBS] get Global Coordinates (LocalToGlobal)   -   Brian Rathbone

[MBS] get Global Coordinates (LocalToGlobal)
Date: 14.01.04 08:04 (Wed, 14 Jan 2004 02:04:23 -0500)
From: Brian Rathbone
Greetings,

I would like to use PressKeyMBS to move the mouse cursor but I am having
some trouble figuring out how to get the global screen coordinates.

Is there a way with RB or MBS to get the global coordinates for a set of
local coordinates? Cross platform?

I am using MacOS 10.2.6 and RB 4.5.3
I currently have MBS 3.3 installed.

Thanks,

Brian

Re: [MBS] get Global Coordinates (LocalToGlobal)
Date: 14.01.04 19:46 (Wed, 14 Jan 2004 19:46:06 +0100)
From: Christian Schmitz
Brian Rathbone <<email address removed>> wrote:

> Greetings,
>
> I would like to use PressKeyMBS to move the mouse cursor but I am having
> some trouble figuring out how to get the global screen coordinates.

What kind of trouble?

e.g.

x=window.left+canvas.left+10

Is 10 Pixels from the left side of the canvas to right.

Mfg
Christian

Re: [MBS] get Global Coordinates (LocalToGlobal)
Date: 14.01.04 20:46 (Wed, 14 Jan 2004 14:46:34 -0500)
From: Brian Rathbone
>
> What kind of trouble?
>

Sorry for the poorly written post. I was confused.

I had two problems.

1. On Mac, the mouse cursor would move vertically, but was always to the
far left. This turned out to be a bug in my code that only affected Mac. I
fixed it.

2. On Windows, the mouse would move in all directions, but only a very
small amount. I just noticed that the MBS docs indicate the
PressKey.MouseMove on Windows "Does nothing". It looks like it actually
does work, but you need to pass x,y coordinates based upon the virtual
screen. I found some info that indicated that the virtual screen
coordinates, for the primary display on Windows, have a range of 0-65535

I am using the following code and it is now working on all of my test
machines.

p = new PressKeyMBS
#if TargetWin32 then
p.MouseMove x * (round(65535 / screen(0).width), y * round(65535 /
screen(0).height)
#else
p.MouseMove x,y
#endif

Please let me know if there are some other reasons, that you know of, that
PressKey.MouseMove shouldn't work or be used on Windows.

Thank you,

Brian