Open cdhanna opened 3 months ago
Oh I see, there is a file, /Desktop.Robot/Source/osx_arm/main.mm
and I'm assuming I can build this similar to the osx build.sh script
Oooh, okay I fixed it. I'll try and open a second PR in a bit. (I have a pending one that I need my local version for, and I don't want to do the gits right now)
But, in general, I added this function to the Source/osx_arm/main.mm
file,
void sendCommandDownWithoutHotkey(short input){
CGKeyCode inputKeyCode = input;
CGEventSourceRef source = CGEventSourceCreate(kCGEventSourceStateCombinedSessionState);
CGEventRef saveCommandDown = CGEventCreateKeyboardEvent(source, inputKeyCode, true);
CGEventPost(kCGAnnotatedSessionEventTap, saveCommandDown);
CFRelease(saveCommandDown);
CFRelease(source);
}
And then also this one,
void sendCommandWithoutHotkey(short input){
sendCommandDownWithoutHotkey(input);
sendCommandUp(input);
}
And then I changed the KeyPress
implementation in the ARM Robot implementation to use that new sendCommandWithoutHotkey
method. And now it works as expected.
Oh, and I re-ran make
in the Source/osx_arm/
directory.
I have this code,
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 theKeyPress(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?