Controlling a keyboard by code

Hello all

I found a thread that showed how to control the mouse from code:

I tried finding something similar but for the keyboard. Actually what I am trying to do is to use the code explained in the aforementionned thread to move the mouse and click in a field and I need the code to enter some info. I could not find anything.

Can it be done?

Thanks

Rick

Hello,

You can use the setfocus method of the control to direct the user there, no need to move the mouse and click anything.

Or are you after something else?

Julen

I am always searching where is my mouse in my 3,360 x 2,100 pixels screen and you want to move my mouse in my back ?
No thank you.

Richard, please take this as humor, but, think twice.

The set focus advice can be better - if the control have a focus ring - because it will have a user feedback: the focus ring appears and tell the user: I am here … I am here … I am here …
:wink:

I did something like that on windows. https://forum.xojo.com/32291-filling-clipboard-with-sendkeys-c

There is a class from Christian that supports all OS. RemoteControlMBS

I use RemoteControlMBS for my Char Menu program. Works great on Mac as well as Windows.

On PC, SendKeys is nice as well.

Hello all

Thanks for your replies. Just to be clear: I am trying to control applications not made in Xojo for tutorial purposes. For example, the mouse would move to the Chrome’s address bar and Xojo would type a web address bar.

I will experiment with the Sendkey function.

Thanks

Richard