APC-40 - Davinci Resolve Mouse Drag

OK, it looks like I posted the wrong project. Take a look at this one.

The Preset ‘Init’ handles initialization of global variables when either the project starts or a keystroke Cntrl-Num5 is pressed.
The ‘Mouse Drag’ handles the mouse click and drag movement

Translator 1.0 looks at CC 47, which is the Cue Level Encoder of the APC-40 and sets the direction and distance that you moved the encoder in the global variable gb. When done, it starts a one shot timer ‘Mouse’ that starts the whole process in action.

Translator 1.1 clicks the Mouse button down at the current mouse position. It then increments the value of ga so that you don’t get multiple mouse down action. Essentially ga is a step counter to tell each translator when it is to execute. It will only executer if ga=0

Translator 1.2 will move the the mouse either left (gb<0) or right (gb>0). depending on the direction you moved the encoder. It will only executer if ga=1.

Translator 1.3 Sets a 1 second timer ‘Watchdog’ so that when you stop moving your encoder, we can release them mouse and set the step counter ga back to 0.

Translator 1.4 is tripped after 1 second of no activity and sets the step counter back to zero and then performs a left mouse click up.

Play close attention to the rules to see the logic in what is happening.

I set up the global variable zz so that if it is a value other than 0, Only log messages will be shown and the actual mouse will not do anything. This is handy for debug purposes to ensure the sequence is working correctly without causing and damage before you actually try it. You can set it to 1 in translator 1.0 for debugging, otherwise, set it to 0.

Here is my log window when testing and zz=1

3462559 - 1.1:2 Log Left Mouse Click Down
3462559 - 1.2:2 Log Mouse Move 10
3462590 - 1.2:2 Log Mouse Move 10
3462609 - 1.2:2 Log Mouse Move 10
3462650 - 1.2:2 Log Mouse Move 10
3463650 - 1.4:1 Log Watchdog Tripped
3463650 - 1.4:2 Log Mouse Left Click Up
3464469 - 1.1:2 Log Left Mouse Click Down
3464469 - 1.2:2 Log Mouse Move -10
3464520 - 1.2:2 Log Mouse Move -10
3464559 - 1.2:2 Log Mouse Move -10
3464600 - 1.2:2 Log Mouse Move -10
3464640 - 1.2:2 Log Mouse Move -10
3464679 - 1.2:2 Log Mouse Move -10
3465679 - 1.4:1 Log Watchdog Tripped
3465679 - 1.4:2 Log Mouse Left Click Up

APC-40 Drag Mouse with Cue Level.bmtp (2.7 KB)

I have my aliases set up as follows:

image

You can learn more about aliases from this tutorial.

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz