Can anyone point me in the right direction of synthesizing mouse and keyboard events on windows in Rust? My ultimate goal is to interact with a time tracking app hosted on a website which takes input via click-dragging a visual representation of a week divided into 30 minute increments.
It may be easier to drive the browser. Have you consider that path?
If I remember correctly mouse_event is used to synthesize ... well ... I suspect you can figure that out. And there's keybd_event. My recollection is that they both work but it's a tedious slog; that both functions are well under-documented. I recall having to work out the various arguments through trial-and-error.
This function does not reset the keyboard's current state. Any keys that are already pressed when the function is called might interfere with the events that this function generates. To avoid this problem, check the keyboard's state with the GetAsyncKeyState function and correct as necessary.
Ouch. That just brought back a bunch of painful memories.
Check out the fantoccini crate. It's essentially a remote control for your browser, letting you do things like go to a URL, find elements on the page, click on things, fill in forms, etc.