[HIDMacros] - Repeating a progresive +3º increment in X axis roll, after keypress
Posted: 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:
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!
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"
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!