Hey @hey2495,
okay, this changes things a bit. I also overlooked the SetCursorPos in your first posting, I do not know what you are exactly doing, but setting the cursor position is a bit unusual for a plugin.
When you say "G/R/S transform" I assume you are trying to implement some kind of move/scale/rotate gizmo for your tool plugin? And the main issue you currently have is that when you set the cursor, that you read (from your perspective) incorrect input information?
As you said it yourself, I would try to switch to input states here rather than events. You gave the special condition that your events are without any button being pressed which is rather unusual for Cinema event polling. I would have to check myself having no pressed button impacts mouse pos polling.
I would for sure use here the global input polling (cinema::GetInputState and not the specialization attached to viewports or dialogs. You talk about screen borders and using there a filtered version of the input stream (even when you viewport or dialog seemingly fills the whole screen) does not seem like a good idea.
There is EVMSG_ASYNCEDITORMOVE, a core message that is sent when the user moves something in the editor window. Our Cappucino mouse movement recorder tool uses this.
Is there a supported Cinema 4D C++ SDK input callback or API that can supply mouse movement during a keyboard-initiated, button-free modal interaction with documented semantics that distinguish real user motion from SetCursorPos()-related repositioning or delayed events?
Our input handling is probably about thirty years old (with improvements made along the way). The rigid modern day system boundaries you are asking for (does this and that under these conditions) do not exist. This was written in a time when devs thought using more than one character for a variable name is something offensive
When you implement a tool (be it ToolData or ToolDescriptionData), you should use its mouse and keyboard functions to track inputs. Using a scene hook (which would also have dedicated polling functions) and on top manual polling also seems not necessary (but I only have a very superficial view on your project).
When you are still stuck, I would recommend sharing a brief executable/compile-able code snippet, so that I can better understand what is going wrong for you. And with executable I mean for example a minimal SceneHook impl that shows your problem. There are so many things that could go wrong for such a delicate issue as yours. But my key idea would be that you might operate on stale data when polling for events instead of states.
we want to avoid taking ownership of Cinema 4D's window event loop.
This could mean a lot, but a plugin which does runtime monkey patching is not allowed. Maybe I am misunderstanding you here, but at face value, 'taking ownership of Cinema 4D's window event loop' is absolutely off limits and we will ban any plugin ID and their owners who would attempt to do such openly malicious actions.
Cheers,
Ferdinand