Moving the cursor within a Canvas

Is there a way to move the cursor to a new location within a canvas? Besides using the mouse of course.

a canvas doesn’t HAVE a cursor… its a “drawing” object… not a text object

What I meant was, let’s say that the cursor is located at a canvas location of X= 10 and Y = 10 and I want to move to to x= 100, Y = 100 relative to the canvas area, that is add a cursor offset 90 on both directions without moving the mouse. It’s not a question of moving the cursor within a text object.

there is NOTHING to move…the canvas has NO CURSOR.
you can draw lines, circles and other shapes by specifiying the coordinates… but that is not a cursor

exactly what are you attempting to do?

What you are describing with a canvas object makes no sense. Please tell us what you’re trying to accomplish.

Forget about the canvas. I just want to move the pointer on the screen to another location without using the mouse.

that is a TOTALLY different thing, and would depend on what operating system etc… as it is NOT a built-in feature of Xojo

You cannot do that using Xojo code.
On Windows, you could use the API call SetCursorPos

if you just want an arrow to point at something, draw your arrow in code, forget the ‘real’ mouse pointer.

Two possible ways
https://forum.xojo.com/47220-move-mouse-position-win-10-64bit-prevent-screen-sleep

https://forum.xojo.com/35317-move-and-get-mouse-cursor-position-osx-declare

Both require declares for the different OS.

Claes:
do you really want to run a software who moves the Cursor in your back ?

If you are a youngster and your monitor size is small, but not if you are an oldster and have a large monitor (with a small diagol-nal ex. 13" and near 4K).

Think twice before doing so. That said, it is your software and do what you think is best for you.

Moving the mouse cursor is not recommended by Apple Human Interface Guidelines or Microsoft Apps Design Guidelines.

The user may think the app is bugged and simply quit.

Or worse, that the system is corrupted.

if you MUST emulate the cursor being moved, try this

  • set the system cursor to invisible
  • move a small canvas with an image of the cursor around the screen

I do indeed want to be able to move the cursor as it makes my program dramatically more efficient. I could have demonstrated why with a short movie but it would be too big to publish on this forum.

I am a big fan of the Apple User Interface Guidelines, and try to follow it as much as I can. I have however noted that even the biggest vendors sometimes break it. As an example, the edition of Photoshop I have, uses an incorrect command for hiding the app, which still drives me crazy after many years of use.

Anyway, Björn at Einhugur Software, who wrote the original plug-in, has promised to have a look at the matter. Thanks Björn!