[HIDMacros] - Repeating a progresive +3º increment in X axis roll, after keypress

How can be this controlled in that simulator? Can HIDmacros be used with this application?
Post Reply
viktorrios
Posts: 8
Joined: 05 Sep 2021, 04:37

[HIDMacros] - Repeating a progresive +3º increment in X axis roll, after keypress

Post by viktorrios » 16 Dec 2021, 19:10

Hi. I am using Blender and HidMacros.

CONTEXT OF THE FUNCTION

On my regular typing keyboard, I'd press "R"(rotate mode), then "X" (lock axis), and then move the mouse left or right and this will (internally) increment the rotation by 1º positive or 1º negative depending on the mouse position towards the right or left, respectively. Depending on how far the mouse moves, the degree number increases or decreases. Let's settle our current X roll value to something like 30º for demonstration's sake.

So If my mouse was settled on x600,y900 on-screen coordinates, and I do "R,X" and move the mouse to the right a hundred pixels, the X-axis will rotate 100º immediately. So the new X roll axis will result in 130º.

Sometimes you require a lot of precision, so pressing "SHIFT" will slow down the roll by 50%. So, when you press "R,X", SHIFT, you will move your mouse to the right, but the X-axis will roll slowly adding 50º to the current value of the X roll. In our example 30º+50º=80º in the X-axis.


CODING THE FUNCTION

In HIDMacros, I assigned the "5" keypress to do a positive degree increment of 3º in the X-axis.

So my Action Scripted command looks like this:

Code: Select all

'HIDmacros command

HIDMacros.SendKeys "r,x,3"
The problem is that the "press" event keeps repeating "r,x,3", "r,x,3", "r,x,3" and what I would need it to do is to start "R,X" and from there the "while on press" event, should send a "mouse drag 3 pixels to the right". As long as I keep pressing "5" the mouse drag will continue to add +3º in the loop.

To finish the event, it needs to register a "left mouse click" after I "release" the 5 key, approximately 0.5 seconds later (no other keypress (or hold) timer registers after 0.5 seconds)

Please, help me. Thanks! 😔

viktorrios
Posts: 8
Joined: 05 Sep 2021, 04:37

Re: [HIDMacros] - Repeating a progresive +3º increment in X axis roll, after keypress

Post by viktorrios » 16 Dec 2021, 19:11

I also tried to feed the buffer with a variable to keep adding to positive degree numbers, but it doesn't work.
Please help.

Code: Select all

'HIDmacros command
Dim rot
rot = HIDMacros.GetBuffer
HIDMacros.SendKeys "r,x,rot"
HIDMacros.ClearBuffer

viktorrios
Posts: 8
Joined: 05 Sep 2021, 04:37

Re: [HIDMacros] - Repeating a progresive +3º increment in X axis roll, after keypress

Post by viktorrios » 06 May 2022, 13:06

Please help me.
I wish to know how to input a command for the sequence to "wait" until it triggers the next commands.
I also need to know how to tell the current position of the cursor to move in its X current position+5. Pause, and then continue
with the next set of instructions.

Please help.

Post Reply