Mouse click and drag left right

Hi there,

I want to make a script wich can go to a position click and drag left or right how i rotate my knob. So i made

  1. Mouse move and click down
  2. Timer Drag
  3. Mouse move left right (here i don't know how to do it)
  4. Timer drag mouse click UP

How i can configure my rules that he know where i rotate left or right? (my knobs are 0-127 and i have X-touch Mini)

Thanks,

The below post should help:

https://www.bome.com/support/kb/midi-controller-to-mouse-question-help

I recommend you use X-touch editor and make your knob relative instead of absolute, but if you insist on absolute, you can do something in MT Pro to convert it to relative. See the below tutorial:

https://youtu.be/VCvxPZawJyE

 

Steve Caldwell
Bome Q and A Moderator and
Independent Bome Consultant/Specialist
bome@sniz.biz

Thanks for reply. I need knobs to be relative because i use x-touch with midi2lr on Lightroom. I resolve like this:

_____________________________________________________________
[x] Preset 0: Init

[x] Translator 0.0: Project Opened
Incoming: Project Opened
Outgoing: One-shot timer "Init": 0 ms delay

[x] Translator 0.1: Esc Init
Incoming: Physical Keys: Esc
Outgoing: One-shot timer "Init": 0 ms delay

[x] Translator 0.2: Init Global Variables
Incoming: On timer "Init"
Rules:
// ga = value of the knob for scroll wheel
// This will be updated when the actual knob
// is moved. Let's start it at 1/2 wa
ga=64
Outgoing: (none)

_____________________________________________________________

[ ] Preset 3: DR Contrast

[x] Translator 3.0: Move knob 64
Options: swallow
Incoming: Control Change on ch. 11 with any CC# set 'qq' to CC# with any value
Outgoing: Control Change on ch. 11 with CC#:qq and value:64 (0x40), to port X-TOUCH MINI

[x] Translator 3.1: Mouse Move and click
Options: swallow
Incoming: Control Change on ch. 11 with any CC# set 'qq' to CC# with any value
Rules:
if g0==1 then exit rules, skip Outgoing Action
g0=1

//CONTRAST
//ga=491
//gb=1966
if qq==1 then ga=482
if qq==1 then gb=1966

//PIVOT
//ga=693
//gb=1966
if qq==2 then ga=693
if qq==2 then gb=1966

//SATURATION
//ga=865
//gb=1966
if qq==3 then ga=865
if qq==3 then gb=1966

if qq>3 then exit rules, skip Outgoing Action

Outgoing: Left mouse button down at ga,gb on primary display

[x] Translator 3.2: Timer Drag
Options: swallow
Incoming: Control Change on ch. 11 with any CC# and any value
Outgoing: One-shot timer "Drag": 250 ms delay

[x] Translator 3.3: Mouse move left
Options: swallow
Incoming: Control Change on ch. 11 with any CC# and any value set 'pp' to value
Rules:
if pp<65 then gr=-5
if pp>65 then gr=5
Outgoing: Mouse move gr horizontal

[x] Translator 3.4: Timer Drag and Mouse click UP
Incoming: On timer "Drag"
Rules: g0=0
Outgoing: Left mouse button up

There is any solution on

“if qq>3 then exit rules, skip Outgoing Action”

to do nothing if qq>3 ?

Thanks,

Hi,

Your drag operation is occurring immediately while your click is being delayed by the timer.

You need to use a timer and global variables for your drag operation

- Translator that monitors incoming CC and puts the value in a global variable (since the timer will not see local variables). All this timer should do is store the global variable you want for the drag operation. No outgoing action.

After click operation you need to then trigger the drag operation which should look at the global variable set by the translator above  to determine the drag direction. and distance.

So essentially you uncouple the CC incoming value with the outgoing operation by a timer.

 

Steve Caldwell
Bome Q and A Moderator and
Independent Bome Consultant/Specialist
bome@sniz.biz

I tried something, hope it\'s ok

It looks OK, did you try it?