Desktop.Robot icon indicating copy to clipboard operation
Desktop.Robot copied to clipboard

OSX ARM - KeyPress(Key.Right) jumps all the way to end of line

Open cdhanna opened this issue 1 year ago • 2 comments

I have this code,

await Task.Delay(500);
var robot = new Robot();
robot.AutoDelay = 1000;
robot.KeyPress(Key.Right);
Console.Beep();

And if I run the code while my cursor is sitting in the middle of some text, then the cursor will jump all the way to the end of the line.

I would expect that the cursor would only move 1 space to the right. However, the actual behaviour is closer to me holding COMMAND and then pressing the right-arrow key. (that will jump to the end of text in osx).

I've tried manually doing a KeyUp(Key.Command) before the KeyPress(Key.Right), but that doesn't seem to make a difference.

I'd love to try and help solve this, but the call to the .so file seems opaque to me. How are those files generated?

cdhanna avatar Jun 24 '24 12:06 cdhanna